# Custom table from csv file (multiple header rows)

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?

• Welcome to TeX.SE. t would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. And include some sample data, along with some details as to the hierarchical grouping that you are referring to. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Nov 7 '14 at 7:59
• My recent answer How to print addresses shows how to read a CSV without headers. Perhaps that will get your problem solved. If not, please make an attempt to show exactly what the problem is. – Peter Grill Nov 7 '14 at 8:01
• Using the datatool package, it is possible to add header rows above the default one by redefining \dtldisplaystarttab. On long tables, this will be added above the header line on all the pages. Other hooks are available, see p49 of the documentation. – TonioElGringo Nov 7 '14 at 8:15

\documentclass{article}