I want to read from a csv
file:
\documentclass{article}
\usepackage{csvsimple}
\begin{document}
\csvautotabular{initial.csv}
\end{document}
Now my initial.csv
file looks like this:
a, # b
1, 3
It creates the following errors:
Illegal parameter number in definition of \csv@col@body \csvautotabular{initial.csv}
Illegal parameter number in definition of \csv@temp \csvautotabular{initial.csv}
You can't use `macro parameter character #' in restricted horizontal mode \csvautotabular{initial.csv}
Then I tried with replacing #
by \#
. It gives:
Missing \endcsname inserted \csvautotabular{initial.csv}
Extra \endcsname \csvautotabular{initial.csv}
File ended while scanning use of \pgfkeys@temp
Any idea on how should I try if my csv
file contains some #
's?
Best Answer
As @wipet wrote, the problem is the catcode of the
#
sign. With the recent version1.12 (2014/07/14)
ofcsvsimple
, you can neutralize the#
sign with therespect sharp
option:There are some more
respect xy
options which also may be interesting for other use cases, e.g.respect and
(for&
) andrespect dollar
(for$
).