In Latex, I am using pgfplotstable and longtable to tabulate values from a csv file containing comma-separated values. As seen below, each row contains 8 values separated by commas in the csv file, which I convert to a table with the following code:
\documentclass[a4paper, 12pt, oneside]{book} \usepackage{pgfplotstable} \usepackage{longtable} \begin{document} % For skipping headers \pgfkeysifdefined{/pgfplots/table/output empty row/.@cmd}{ \pgfplotstableset{ empty header/.style={ every head row/.style={output empty row}, } } } \pgfplotstabletypeset[ empty header, begin table={ \centering \begin{longtable}{l l l l l l | l l} \caption{data_table_name} \\ \toprule Col_1 & Col_2 & Col_3 & Col_4 & Col_5 & Col_6 & Col_7 & Col_8 \\ \midrule \endfirsthead % for first table \toprule Col_1 & Col_2 & Col_3 & Col_4 & Col_5 & Col_6 & Col_7 & Col_8 \\ \midrule \endhead % for later tables \midrule \multicolumn{8}{r}{\textit{Continued on next page}} \\ \bottomrule \endfoot % for first table \bottomrule \endlastfoot, % for later tables }, end table=\end{longtable}, col sep=comma, string type, header=true, ]{my_data.csv} \end{document} I am able to create my table in latex without any problems, but for some reason I end up with ,cccccccc in the first cell (together with the first value of the first row) before all the other values follow correspondingly. This only happens when I combine I also use longtable; pgfplotstable alone gives me the formatted table I need, but my data spans several pages. How do I get rid of this ,cccccccc and why is this produced to begin with? Is it something to do with the formatting "{l l l l l l | l l}" ?
Sample of outputted table, containing the error in the first cell:


\documentclassand ending with\end{document}, to make your code fragment compilable.\centeringwith longtable (it won't centre it)csvsimplepackage that can assist you in creating tables from CSV filesy