The header column names in my CSV contain spaces. Is there a way to still import it using csvsimple
or maybe some other package? That way I would be able to specify data in CSV, import it and render it automatically as a table via a package. Additionally, since the headers are long, I'd like the table to expand up to page width and wrap long headers.
\begin{filecontents*}{forum_posts_table_1.csv}
posts per author,sentences per post,quoted sentences per post,EREs per post,mentions per ERE
3.1,23.83454,2313.27,13453453.8,2464642.43
\end{filecontents*}
readarray
package can help. I could try to compose an answer, if I could understand how you want the data to be digested and recalled.readarray
, make sure you employ the latest version (2.0), dated2016/11/07
pgfplotstable
can also read this file without problems.\documentclass{article} \usepackage{readarray}[2016-11-07] \usepackage{filecontents} \begin{filecontents*}{forum_posts_table_1.csv} posts per author,sentences per post,quoted sentences per post,EREs per post,mentions per ERE 3.1,23.83454,2313.27,13453453.8,2464642.43 \end{filecontents*} \begin{document} \readarraysepchar{,} \readdef{forum_posts_table_1.csv}\mydata \readarray*\mydata\myarray[-,\ncols] Column 3 title is ``\myarray[1,3]''.\par Column 3 data is ``\myarray[2,3]'' \end{document}
csvsimple
). Spaces inside the header are no problem as far as you do not make automated macros withhead to column names
.