3

I'd like the columns ColHead6--ColHead10 to be put under the first set of five columns (of course with the first column on the left once again). How can I do that?

And could I use \multicolumn{6}{c}{Dataset 2} in between the stacked/converted columns?

MWE

\documentclass{scrartcl}

\usepackage{pgfplotstable}

\begin{filecontents}{data.txt}
Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10
A,17,19,15,17,3,8,14,7,8,14
B,10,8,11,15,10,8,6,13,13,10
C,20,5,16,12,8,5,16,7,14,17
D,14,4,10,14,16,14,5,10,5,11
\end{filecontents}

\pgfplotstableread[col sep=comma]{data.txt}{\mydata}

\begin{document}
\begin{center}
\pgfplotstabletypeset[columns/Word/.style={string type}]{\mydata}
\end{center}

\end{document}

1 Answer 1

4
\documentclass{scrartcl}

\usepackage{pgfplotstable}

\begin{filecontents}{data.txt}
Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10
A,17,19,15,17,3,8,14,7,8,14
B,10,8,11,15,10,8,6,13,13,10
C,20,5,16,12,8,5,16,7,14,17
D,14,4,10,14,16,14,5,10,5,11
\end{filecontents}

\pgfplotstableread[col sep=comma]{data.txt}{\mydata}

\begin{document}
\begin{center}
data set 1

\pgfplotstabletypeset[columns/Word/.style={string type},
columns={Word,ColHead1,ColHead2,ColHead3,ColHead4,ColHead5}]{\mydata}

data set 2

\pgfplotstabletypeset[columns/Word/.style={string type},
columns={Word,ColHead6,ColHead7,ColHead8,ColHead9,ColHead10}]{\mydata}
\end{center}

\end{document}
3
  • Well for the record that was true to the letter and working. :) Could you also please, if possible, provide a solution for the case when there shall 1. be no row in between the subsequent sets of new rows/columns but an additional vertical space, say something which roughly mimics \addlinespace[3pt] from the booktabs package and 2. no new printing of the column headings?
    – henry
    Commented Oct 5, 2014 at 16:12
  • @henry you mean replace data set 2 by \vspace{2in} or whatever you need? for not printing the headings i assume there is a key for that you can use on the second table, I've never used the package:-) Commented Oct 5, 2014 at 16:23
  • Oh, I see. Ok I will open a new question then.
    – henry
    Commented Oct 5, 2014 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .