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.


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

|improve this answer|||||
  • 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 '13 at 0:58
  • @Sachin_ruk I've edited the example to include rounding to 2 d.p. – Nicola Talbot Jul 9 '13 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

|improve this answer|||||

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.