[Tex/LaTex] EViews Output and Tables

tables

EViews has an add-in which apparently outputs latex, but I can't install it on my faculty computers. I can save the output as a csv. Is there any way of me creating nicer looking tables in my document without having to input the numbers in manually?

Best Answer

I'd take pgfplotstable to typeset csvdata as a table. It is a highly configurable package. I cannot compare it to datatool or csvsimple (see comment of @Paul Stanley) though, because I haven't used one of them. The following code shows a simple example with three different column types. For more options see the comprehensive manual of pgfplotstable.

\documentclass{article}

\usepackage{filecontents}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{booktabs}

\begin{filecontents}{data.csv}
Month, Small Value, Large Value
January, 12.50, 12.3E5
February, 3.32, 8.7E3
March, 43, 3.1E6
April, 0.33, 21.2E4
May, 5.12, 3.45E6
June, 6.44, 6.66E6
July, 123.2, 7.3E7
August, 12.3, 5.3E4
September, 2.3, 4.4E4
October, 6.5, 6.5E6
November,0.55, 5.5E5
December,2.2, 3.3E3
\end{filecontents}

% Define style for cvs file format
\pgfplotstableset{
    csv file/.style={col sep=comma,row sep=newline}
}

% Add rules for all 'pgfplotstable's
\pgfplotstableset{
    every head row/.style={
        before row=\toprule,after row=\midrule},
    every last row/.style={
        after row=\bottomrule}
}

\begin{document}
\pgfplotstabletypeset[csv file,
        column type=l, % default is left alignment
        columns/Month/.style={string type},
        columns/Small Value/.style={dec sep align}, % align at the decimal point
        columns/Large Value/.style={sci,sci sep align} % use scientific notation                                         
        ]{data.csv}
\end{document}

enter image description here