[Tex/LaTex] Custom table from csv file (multiple header rows)

csvdatatooltables

I would like to create custom tables from .csv files. By custom I mean, that I only want LaTex to read in the body of the table, i.e. "a & b & … \ …" but I want to write my own header and formating around it (I know names and number of columns).
I am aware of the package datatool, but this seems to only
provide a function for loading an entire table (with a single header row constructed from variable names). I need to have multiple header rows for hierarchical grouping of columns however. Manual input of the numbers is not really an option – too many numbers 😉

How would I best do such a thing in LaTex?

Best Answer

Thank you @TonioElGringo, that does exactly what I was looking for. Here an example for a 3 column .csv file.

\documentclass{article}
\usepackage{datatool}
\usepackage[margin=1in]{geometry}
\begin{document}
\DTLloaddb{stores}{scientists.csv}
\renewcommand{\dtldisplaystarttab}{\multicolumn{3}{c}{I am what I was looking for!}\\}
\DTLdisplaydb{stores}
\end{document}
Related Question