I have a dataset in csv file format that I'm loading into pgfplotstable
. I can't change the format of the original csv, and being financial data it has a column of item names and two or three explanatory data points at the top of the table. e.g.
\documentclass{article}
\usepackage{array,datatool,pgfplotstable}
\begin{filecontents}{sample.csv}
item,2008,2009,2010,2011
,Actual,Actual,Forecast,Forecast
,GBP,GBP,GBP,GBP
,('000),('000),('000),('000) rounded
Area 1 OP, 1000000,1500000,1750000,250000
Area 2 OP, 400000,500000, 450000,-50000
Area 51 OP, 300000,375000,390000,15000
No P, 1250000, 1000000, 950000, 50000
Residuals, 800000, 80000, 90000, 10000
\end{filecontents}
\pgfplotstableread[col sep=comma]{sample.csv}\mystuff
I'm stumped at the next stage which is to typeset \mystuff
so I have comma separators and can add a row that sums the 'Area' columns. At the moment to display the table I have to do something like
\begin{document}
\pgfplotstableread[col sep=comma,header=false]{sample.csv}\mystuff
\pgfplotstabletypeset[
columns/0/.style={string type},
columns/1/.style={string type},
columns/2/.style={string type},
columns/3/.style={string type},
columns/4/.style={string type}]\mystuff
\end{document}
How do I tag the top three rows as string and the rest of the last four columns as integer type so I can format and transform them?