Graphics, Figures & TablesRearranging and formatting columns and headers with datatool

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Kit
Posts: 4
Joined: Mon Nov 15, 2010 6:34 pm

Rearranging and formatting columns and headers with datatool

Post by Kit »

I have been tasked with a gigantic report that requires four "lookup" tables, one for each of four fields. I initially used datatool to bring in the data and sort it according to whichever field I needed, but this isn't producing quite what I want it to. Here is the working example:

Code: Select all

\documentclass{article}
\usepackage[colorlinks, linkcolor=black]{hyperref}
\usepackage{datatool}
\title{Huge Education Report}
\author{Kit}
\date{December 31, 2010}
\DTLloaddb{cases}{LDERtocClean2.csv}
\begin{document}
\maketitle
\section{Unit Listing}
\DTLsort{Unit}{cases}
\DTLdisplaydb{cases}
\section{Town Listing}
\DTLsort{Town}{cases}
\DTLdisplaydb{cases}
\end{document}}
I believe datatool and hyperref are available through CTAN, and the csv file is attached to this post.

This produces a nice set of sorted tables, but I can't seem to figure out if datatool can be used to rearrange the columns so that the sorted column is first. Also, is it possible to get the column headers to display at the top of each page? Lastly, I can't figure out where to put the commands to alter the table formatting (e.g., to put a line after the header, or left justify a column).

Can anybody give me an example of how to do these things (or tell me that it can't be done)? Thank you.

-- Edited: I just realized that I forgot the attachment when I moved this post to the Tables forum.
Attachments
LDERtocClean2.csv
This is a comma-delimited file with the headers in the first row.
(454 Bytes) Downloaded 246 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply