In the following csv file example, I want to automatically replace a string pattern in all headers cells when importing with pgfplotstable
:
\begin{filecontents*}{sample.csv}
parameter,cubic parameter,revised parameter,"$quartic_{parameter}$"
1 ,13 ,34 ,5
2 ,3 ,7 ,11
\end{filecontents*}
I want to replace the pattern "parameter" by "param" in all header cells.
I tried this :
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\begin{filecontents*}{sample.csv}
parameter,cubic parameter,revised parameter,"$quartic_{parameter}$"
1 ,13 ,34 ,5
2 ,3 ,7 ,11
\end{filecontents*}
\begin{document}
\pgfplotstabletypeset[col sep=comma,row sep=newline,ignore chars={"},string replace*={parameter}{param}]{sample.csv}%
\end{document}
I obtained this result (no expected changes in the headers cell):
I would prefer this result where all the "parameter" words have been replaced by the string "param" even in "math mode" (last column header):
Is there a way to do that automatically in all header cells with pgfplotstable
(I would prefer to use pgfplotstable
but I am open to other solutions)?