1

Is there an appropriate, fast way to print the Celero output (CSV) as a table?

1

I found a nice way to print it in landscape, multi-page way: You need the following packages: ltablex,multirow and pgfplotstable.

\begin{landscape}
\newcommand{\headerCSV}{Group & Experiment & Problem Space & Samples & Iterations & Baseline & us/Iteration & Iterations/sec & Min (us) & Mean (us) & Max (us) & Variance & Standard Deviation & Skewness & Kurtosis & Z Score} % own Header
\setlength\tabcolsep{1.5pt} % save inner margin space
{\tiny
\pgfplotstableread[col sep=comma]{diagrams/results.csv}\data % Your CSV file
 \pgfplotstabletypeset[%
    begin table=\begin{tabularx}{\hsize},
    % Multi Page setup:
    every first row/.append style={before row={%
        \headerCSV \\ \hline
     \endfirsthead
         \multicolumn{16}{c}%
         {\textbf{Continued from previous page}} \\
         \hline
         \headerCSV \\ \hline
     \endhead
         \hline 
         \multicolumn{16}{c}%
         {\textbf{Continued on next page}} \\
     \endfoot
         \hline
         \multicolumn{16}{|r|}{{Concluded}} \\ 
         \hline
     \endlastfoot
     }
 },%
    end table=\end{tabularx},
    %
    column type/.add={|}{},
    empty cells with={---}, %replace empty cells with ’--’
    % Custom columns settings for every Celero output row
    columns/Group/.style={string type, column type=|l},
    columns/Experiment/.style={string type, column type=|l},
    columns/Problem Space/.style={string replace={-9223372036854775808}{}, column type=|X}, % no Problem Space --> empty
    columns/Samples/.style={column type=|X},
    columns/Iterations/.style={column type=|X},
    columns/Baseline/.style={column type=|X},
    columns/us/Iteration/.style={column type=|X},
    columns/Iterations/sec/.style={column type=|X},
    columns/Min (us)/.style={column type=|X},
    columns/Mean (us)/.style={column type=|X},
    columns/Max (us)/.style={column type=|X},
    columns/Variance/.style={column type=|X},
    columns/Standard Deviation/.style={column type=|X},
    columns/Skewness/.style={column type=|X},
    columns/Kurtosis/.style={column type=|X},
    columns/Z Score/.style={column type=|X|},
    every head row/.style={%
        after row=\hline,output empty row
    },
    columns={Group,Experiment,Problem Space,Samples,Iterations,Baseline,us/Iteration,Iterations/sec,Min (us),Mean (us),Max (us),Variance,Standard Deviation,Skewness,Kurtosis,Z Score},%
    /pgf/number format/fixed,
   /pgf/number format/precision=5,
]{\data}
} % end tiny
\end{landscape}

Example PDF: First page Second page

EDIT: Credits to @harish-kumar for the basic concept.

Full MWE:

\documentclass[%
    pdftex,
    a4paper, 
    %letterpaper,
    oneside,        % Einseitiger Druck.
    12pt,           % Schriftgroesse
    parskip=half,   % Halbe Zeile Abstand zwischen Absätzen.
%   headsepline,    % Linie nach Kopfzeile.
    footsepline,    % Linie vor Fusszeile.
    plainfootsepline,
    abstracton,     % Abstract Überschriften
    english,        % Translator
    %enabledeprecatedfontcommands, %enable old commands ot use fancyhdr NOT RECOMMENDED
]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lscape}
\usepackage{pgfplotstable}
\usepackage{ltablex} % mix out of tabularx and longtable
\usepackage{multirow}
\begin{document}
\begin{landscape}
\newcommand{\headerCSV}{Group & Experiment & Problem Space & Samples & Iterations & Baseline & us/Iteration & Iterations/sec & Min (us) & Mean (us) & Max (us) & Variance & Standard Deviation & Skewness & Kurtosis & Z Score} % own Header
\setlength\tabcolsep{1.5pt} % save inner margin space
{\tiny
\pgfplotstableread[col sep=comma]{results.csv}\data % Your CSV file
 \pgfplotstabletypeset[%
    begin table=\begin{tabularx}{\hsize},
    % Multi Page setup:
    every first row/.append style={before row={%
        \headerCSV \\ \hline
     \endfirsthead
         \multicolumn{16}{c}%
         {\textbf{Continued from previous page}} \\
         \hline
         \headerCSV \\ \hline
     \endhead
         \hline 
         \multicolumn{16}{c}%
         {\textbf{Continued on next page}} \\
     \endfoot
         \hline
         \multicolumn{16}{|r|}{{Concluded}} \\ 
         \hline
     \endlastfoot
     }
 },%
    end table=\end{tabularx},
    %
    column type/.add={|}{},
    empty cells with={---}, %replace empty cells with ’--’
    % Custom columns settings for every Celero output row
    columns/Group/.style={string type, column type=|l},
    columns/Experiment/.style={string type, column type=|l},
    columns/Problem Space/.style={string replace={-9223372036854775808}{}, column type=|X}, % no Problem Space --> empty
    columns/Samples/.style={column type=|X},
    columns/Iterations/.style={column type=|X},
    columns/Baseline/.style={column type=|X},
    columns/us/Iteration/.style={column type=|X},
    columns/Iterations/sec/.style={column type=|X},
    columns/Min (us)/.style={column type=|X},
    columns/Mean (us)/.style={column type=|X},
    columns/Max (us)/.style={column type=|X},
    columns/Variance/.style={column type=|X},
    columns/Standard Deviation/.style={column type=|X},
    columns/Skewness/.style={column type=|X},
    columns/Kurtosis/.style={column type=|X},
    columns/Z Score/.style={column type=|X|},
    every head row/.style={%
        after row=\hline,output empty row
    },
    columns={Group,Experiment,Problem Space,Samples,Iterations,Baseline,us/Iteration,Iterations/sec,Min (us),Mean (us),Max (us),Variance,Standard Deviation,Skewness,Kurtosis,Z Score},%
    /pgf/number format/fixed,
   /pgf/number format/precision=5,
]{\data}
} % end tiny
\end{landscape}
\end{document}
1
  • Really Long name ...: The ... is within the name. The whole structure does not shorten any things! – Herget Aug 28 '16 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.