Helping a other communitymember (see using csvreader to read from csv giving invalid output) on a csvreading task I have tried to solve a problem, like the following...
\begin{filecontents*}{test-table.csv}
Name,Value,Text
Test 1,1,A
Test 2,2,B
Test 3,3,A
Test 4,4,B
Test 5,5,A
Test 6,6,B
Test 7,7,A
Test 8,8,B
Test 9,9,A
Test 10,10,B
Test 11,11,A
Test 12,12,B
Test 13,13,A
Test 14,14,B
Test 15,15,A
Test 16,16,B
Test 17,17,A
Test 18,18,B
Test 19,19,A
Test 21,21,B
Test 22,22,B
Test 23,23,B
Test 24,24,B
Test 25,25,B
Test 26,26,B
Test 27,27,B
Test 1,1,A
Test 2,2,B
Test 3,3,A
Test 4,4,B
Test 5,5,A
Test 6,6,B
Test 7,7,A
Test 8,8,B
Test 9,9,A
Test 10,10,B
Test 11,11,A
Test 12,12,B
Test 13,13,A
Test 14,14,B
Test 15,15,A
Test 16,16,B
Test 17,17,A
Test 18,18,B
Test 19,19,A
Test 21,21,B
Test 22,22,B
Test 23,23,B
Test 24,24,B
Test 25,25,B
Test 26,26,B
Test 27,27,B
\end{filecontents*}
\documentclass{article}
\usepackage{longtable}
\usepackage{csvsimple}
\begin{document}
\csvreader[
longtable=lll,
head,
table head={%
\bfseries Name & \bfseries Value & \bfseries Text\\\hline\endhead
\caption{Example}\endlastfoot
},
]{test-table.csv}{
Name=\colname,
Value=\colvalue,
Text=\coltext
}{%
\colname & \colvalue & \coltext
}
\end{document}
Have taken this example from Import multi-page table from PDF as table
Question: Why do I have to include the header manually, the text ist part of the csv input first row. Is there any way to inject the values of the first row to all headers of a longtable?
\bfseriesyou did there. On the other hand try\csvautolongtable{test-table.csv}or\csvautobooklongtable{test-table.csv}– May 08 '15 at 00:20