0

I'm writing my first paper in Overleaf instead of Markdown and struggling with how to insert data programmatically. I have a table of data that gets frequently updated that I want to display in the text. I'm willing to re-upload the .csv to Overleaf every time it gets changed, but I'd strongly prefer to not hard-code the table any further, since it will make it really difficult to update in the future. How do I get Overleaf to render the .csv as a simple in-text Latex table with a caption?

I tried applying readcsv not working as follows:

\usepackage{csvsimple}

\begin{tabular} \csvreader{best_drm_table.csv} \end{tabular}

And got a huge number of errors, including this one, probably the most informative:

l.282     \csvreader
                    {best_drm_table.csv}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
AFH
  • 103
  • 3
  • 3
    This doesn't really end up having much to do with Overleaf. But there are over 300 questions tagged csv, and most of them are about exactly what you're wanting to do. – Teepeemm Feb 22 '24 at 22:37
  • Try for example this answer but use the extension .Rtex instead of .Rnw in Overleaf. – Fran Feb 23 '24 at 01:36
  • 1
    There are the csvsimple and the pgfplotstable packages (among others) that can do such things (the latter might be a bit overkill though). For more detailed help, you should provide some minimal working example. – Jasper Habicht Feb 23 '24 at 12:46
  • We can‘t help you for two reasons: 1. your posted code can‘t compile when we try it.2. A csv file is missing . Hence a reopen isn‘t justified at the moment – MS-SPO Feb 25 '24 at 07:54

0 Answers0