# Get element from a table

I have the following table:

\begin{filecontents}{table.dat}
a   0.70
b   0.58
\end{filecontents}


and I am trying to access at the elements with the command \pgfplotstablegetelem{0}{0}\of\table but I obtain only the following error:

! Package pgfplots Error: Sorry, could not retrieve column '0' from table 'table.dat'. Please check spelling (or introduce name aliases)..

I know that the problem is with the letter, because the error disappear if in the table there are only numerical values.

• use header=false when reading the table. Otherwise we have to see how you coded . – percusse Aug 24 '15 at 15:40
• @percusse You should write an answer :) – Gonzalo Medina Aug 24 '15 at 16:16

If you don't have headers, then you should dispatch that during the table reading. Then you can use the [index] notation for unnamed columns. Otherwise, the parser thinks that there is a column named 0.

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}

gives a as the result.