Mainly I want to do something similar this-

This is the summary 

but this is not compiled

My coefficient.csv looks like-


I want to learn the csvsimple from basic.

  • Welcome to TeX.SX! You can help us to help you by providing the code for a small compilable document that shows your problem called MWE. Just edit your question and add missing code.
    – Bobyandbob
    Commented Nov 14, 2017 at 12:56
  • You should definitely start providing complete documents and not snippets, like you often do. And given that you get errors from that code, you shouldn't be surprised that the output is wrong. And you should have a look at the csvsimple manual, in particular section 2 on page 8, which describes how \csvreader is supposed to be used. Commented Nov 14, 2017 at 13:02
  • @TorbjørnT. My original document is so big. So, I don't want to attach this. I edited my question although the sample code not run.
    – alhelal
    Commented Nov 14, 2017 at 13:13
  • You're not supposed to show your entire document, you're supposed to show exactly what you now have: the smallest complete document necessary to demonstrate the problem. Commented Nov 14, 2017 at 13:15
  • @TorbjørnT. see line 86 on this
    – alhelal
    Commented Nov 14, 2017 at 13:18

2 Answers 2


As described in section 2 of the csvsimple manual, the \csvreader macro takes three mandatory arguments, while you've just added one. That is, the general format is

\csvreader[<options>]{<file name>}{<assignments>}{<command list>}

while you've just used

\csvreader[<options>]{<file name>}

(The \csvautotabular macro on the other hand, as seen in Abo Ammar's answer has just one mandatory argument, the file name.)

The arguments:

  1. The first mandatory argument is the filename of the .csv file.

  2. The second argument assigns macros to the content of the various columns. For example, if you had a .csv file that looked like


    then you would use


    in the second mandatory argument, to define the two macros \foo and \bar, referring to the a and b columns respectively.

  3. The third argument is where you define the format of your table rows, using the macros defined in the second argument. For example

    \bar & \foo

    to print the b column first, and a column second.

  • \csvreader also has an optional argument, where you define the column types of your table (e.g. tabular=cc for two centred columns), and any other formatting you need.

A complete example below, using some bits from the example in section 3.4 of the manual. To remove the quotation marks (") from the first column output, I load the xstring package and use \StrDel{\name}{"} instead of \name in the row format. That will delete all occurrences of ".

output of code

\usepackage{xstring} % defines \StrDel
\usepackage{booktabs} % defines \toprule,\midrule,\bottomrule
  % set up the columns in the table
  % define the content of the first row
  table head=\toprule Name & Estimate & $\mathrm{Pr}(>\mid t)$ \\ \midrule,
  % add rule after table
  table foot=\bottomrule
 ]{coefficient.csv}% filename
{""=\name,"Estimate"=\estimate,"Pr(>|t|)"=\Pr}% define macros that refer to the columns you want to use
{\StrDel{\name}{"} & \estimate & \Pr} % format of rows

  • Doesn't it work if I don't define macro for column?
    – alhelal
    Commented Nov 15, 2017 at 0:30
  • Why did you write the file content again in the code although you use filePath?
    – alhelal
    Commented Nov 15, 2017 at 0:34
  • The "" should be omit. I want to omit these without changing .csv because it's csv formate.
    – alhelal
    Commented Nov 15, 2017 at 0:37
  • @alhelal 1) No, you must assign macro names to columns, but you don't have to assign all the columns. 2) The filecontents stuff is only to make the example self-contained, you can delete it as you already have the file. 3) Load the xstring package and use \StrDel{\name}{"} instead of \name in the row format. Commented Nov 15, 2017 at 6:58

This is the summary 

\csvautotabular[respect dollar=false]{coefficient.csv}


With the coefficient.csv file contents

,Estimate, Pr$(>|t|)$

enter image description here

  • Isn't it possible without changing the content of coefficient.csv? I know csvautotabular. You give me the solution with csvreader.
    – alhelal
    Commented Nov 14, 2017 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .