Closed mikkelee closed 3 years ago
I think that is a valuable enhancement of the column name feature.
I made some tests and there seem to be no problems in implementing it. So, the new option will be part of the next release, but that may come not very soon.
For the meantime, the following patch could be used:
\makeatletter
\def\set@csv@autohead{%
\toks0=\expandafter{\csname\csv@headnameprefix\csv@current@col\endcsname}%
\toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}%
\begingroup\edef\csv@temp{\endgroup\noexpand\gdef\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\noexpand\gdef\the\toks0{}}}%
\csv@temp%
}
\csvset{%
head to column names prefix/.store in=\csv@headnameprefix,%
head to column names prefix=,%
}
\makeatother
Thanks! There's no rush :)
Implemented with version 1.22 (2021/06/07).
I currently name my columns with prefixes in the csv file itself to avoid clashes, but I'd like to be able to configure this, perhaps via
/csv/head to column name prefix=⟨string⟩
. Thoughts?