gtvawe
gtvawe

Reputation: 23

Include CSV file with more than four columns with csvsimple in Latex document by using MikTex

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

Answers (1)

nagimov
nagimov

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

Related Questions