Consider the following plots
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\pgfplotstableread{
1 3 6 4
2 2 5 2
3 4 4 1
4 5 2 3
}\table
\begin{tikzpicture}
\begin{axis}
\foreach \i in {1,...,3}{%
\addplot table[x index=0,y index=\i] {\table};
}
\end{axis}
\end{tikzpicture}
\end{document}
I would like to use it as a template for input files of varying number of columns.
For this I need to replace the 3 ine the foreach command by the number of columns of the loaded table.
Is there something similar to \pgfplotstablecols that would be understood in this environment?
