I'm attempting to use \pgfplotstabletypeset but with no luck. I have a CSV file like the following:

Name, Age, stDev
Adam, 15, 3

When I output in this into my PDF, I would like the last two columns be combined such that I end up with 15 +/- 3. I would also like to name that column Age.


2 Answers 2


I don't know how to do it using pgfplotstable, but here's how to do it with datatool:

Edit: Updated to round to 2 d.p.



Name, Age, stDev
Adam, 15.00201, 3.00601


% Round to 2 dp and display.
% (More efficient to use \dtlround rather than \DTLround as the
% data doesn't involve currencies so no conversion is needed)


\bfseries Name & \bfseries Age%
  \\\Name & $\round\Age\pm\round\stDev$



Image of result

  • just a side question, how would you control the precision? in my actual csv file, there are 4 d.p., I need only 2
    – sachinruk
    Jul 9, 2013 at 0:58
  • @Sachin_ruk I've edited the example to include rounding to 2 d.p. Jul 9, 2013 at 7:25

You need to create a column specification for that.


\pgfplotstableread[col sep=comma]{
Name, Age, stDev
Adam, 15, 3
Eve, 12, 1

create on use/unc age/.style={
    create col/assign/.code={%
        \pgfkeyslet{/pgfplots/table/create col/next content}{\entry}
columns={Name,unc age},
columns/unc age/.style={column name=Age},
string type


enter image description here

You must log in to answer this question.

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