I am aware of the previous post datatool with longtable, but it didn't solve my problem.
I've a document with 10 tables or so, for each table I use this piece of code:
\DTLsetseparator{;} \DTLloaddb{kundt2}{kundt2.csv}\begin{center}\begin{longtable}{|c|c|c|}\caption[De berekende bronsterkte van de buis]{De berekende bronsterkte van de buis} \label{tbl:kundt2} \\\hline\endfirsthead\endhead\endfoot\endlastfoot\DTLforeach{kundt2}{\1=1, \2=2, \3=3}{\ifthenelse{\value{DTLrowi}>0}{\1 & \2 & \3 \\ \hline }{}} \end{longtable}\end{center}
My csv file
1;2;3;444;555;666;111;222;333;
etc., I know that one is fine.
Since I'm Dutch I need to use the ;
sign for separating my csv values. Everything is working great even for tables longer then 4 pages but every single time there is an extra empty cell at the last row. I tried to change this line:
\DTLforeach{kundt2}{\1=1, \2=2, \3=3}{\ifthenelse{\value{DTLrowi}>0}{\1 & \2 & \3 \\ \hline }{}}
to:
\DTLforeach{kundt2}{\1=1, \2=2, \3=3}{\ifthenelse{\value{DTLrowi}>0}{\\ \hline \1 & \2 & \3}{}}
But then I get the extra empty cell at the first row. What am I doing wrong?