Reputation: 23
I am using MikTex and want to include CSV tables in my Tex document. I am using the package csvsimple. The following code works fine to include a CSV file with one to three columns.
\csvreader[separator=semicolon,late after line=\\\midrule,late after last line=\\\bottomrule]{myfile.csv}{}{\csvcoli & \csvcolii & \csvcoliii}
But now I have one more CSV file with four columns.
So I thought I can use:
\csvreader[separator=semicolon,late after line=\\\midrule,late after last line=\\\bottomrule]{myfile.csv}{}{\csvcoli & \csvcolii & \csvcoliii & \csvcoliiii}
But it doesn't work. Error message: Undefined control sequence.
How must I edit the code snippet to include CSV tables with more than three columns?
Thank you.
Upvotes: 2
Views: 2654
Reputation: 130
You can access the entire row of your csv (all columns together) using \csvlinetotablerow
:
\csvreader[separator=semicolon,late after line=\\\midrule,late after last line=\\\bottomrule]{myfile.csv}{}{\csvlinetotablerow}
Upvotes: 4