2

I want to include a csv file as a table into my overleaf-document.

\documentclass[a4paper]{article}
\usepackage{csvsimple}
\csvautotabular{population.csv}

I have no idea, why it is not working. Does someone know ? ;-)

5
  • First of all look at the MWE in my answer here: tex.stackexchange.com/a/578577/231952. Then edit your question, possibly providing a MWE. Your code, as it is, can not work: for example, \csvautotabular must be used in the document body not in the preamble
    – Ivan
    Commented Mar 6, 2021 at 19:15
  • Hi Ivan, thanks for your response! I do include it in the document body. Do I have to do overwrite the file as you did? (That would be a huge amount of characters) ``` \begin{filecontents*}[overwrite]{test.csv} game id,start,dimensions,number of players,error type,survived rounds,avg iter dur,max iter dur 1,,{(46, 58)},6,--,3,0.0189638150252525,0.070585 1,,{(46, 58)},6,--,3,0.0189638150252525,0.070585 ... 6,,{(42, 71)},5,--,63,0.006719767371205704,1.936 \end{filecontents*} ``` Commented Mar 6, 2021 at 21:09
  • 1
    You do not need filecontents in the real life. It's mostly useful for producing minimal working examples.
    – Ivan
    Commented Mar 6, 2021 at 21:26
  • Well, then I still don't know my mistake. I did everything exactly like you suggested :( Do you know another package which I could try? Commented Mar 7, 2021 at 7:48
  • in order to help you, you should open a new question, provide a MWE and explain the details of your problem in more depth. If the code of my answer below doesn't work, it's probably an Overleaf issue.
    – Ivan
    Commented Mar 7, 2021 at 10:15

1 Answer 1

2

Suppose we have this external test.csv file:

Lorem,Ipsum,Dolor,Sit,Amet
one,one,one,one,one
two,two,two,two,two
three,three,three,three,three
one,one,one,one,one
two,two,two,two,two
three,three,three,three,three

Then the following code

\documentclass{article}
\usepackage{csvsimple}

\begin{document}
 
 \csvautotabular{test.csv}

\end{document}

will produce this:

enter image description here

You must log in to answer this question.

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