TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make table in pgfplotstable table form input file

A  B
1.0 20
1.1 21
1.2 22
1.3 23
1.4 24

looks like this one: enter image description here

I trying to use \pgfplotstabletranspose\loadedtable{input.dat} \pgfplotstabletypeset\loadedtable, but column names (A & B) parsing as floats (and gives error). And colnames counting starts from 0 (I need from 1).

And also is it posible to break (hyphenate) large horizontal tables?

share|improve this question
Please add a minimal working example (MWE) that illustrates your problem. (Snippets tend to be much harder to answer.) – Joseph Wright Jul 2 '11 at 6:18
Sorry, next time I add – Molurd Jul 2 '11 at 13:53
up vote 5 down vote accepted

The error for the A and B column comes from the fact that pgfplotstables expects numerical data unless specified otherwise. To make the column handle strings, you have to set columns/colnames/.style={string type}.

To get the index to start at one, I would suggest to create a new column on the fly and using this for the column names with the key colnames from=<name>.

Here's an MWE:



A  B
1.0 20
1.1 21
1.2 22
1.3 23
1.4 24


    create on use/index/.style={%
        create col/assign/.code={%
            \pgfkeyslet{/pgfplots/table/create col/next content}{\entry}

\pgfplotstabletranspose[colnames from=index]\loadedtable{testdata.dat} 

        string type,
        column name={\#}



share|improve this answer
Thanks! All the working. – Molurd Jul 2 '11 at 13:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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