I get a code from @DavidCarlisle, that generate output-txt-files, and I want to put all the outputfiles in a pgfplotstable together.
So I try adding
\ifnum\the\filecount=1 \pgfplotstableread[col sep=comma]{data1.txt}{\main} \else {.........} \fi
But this gives only some strange Omegas and \pgfplotstabletypeset[col sep=comma]{\main}
does not work.
What have I to do?
\documentclass[a4paper]{article}
\usepackage{pgfplotstable}
\newcount\filecount
\newwrite\cisout
\begin{document}
{
\endlinechar=\newlinechar%
\filecount=1 %
\def\aaa{file number \the\filecount}%
\loop%
\immediate\openout\cisout=data\the\filecount.txt %
\immediate\write\cisout{%
111, 222, \aaa
}%
\immediate\closeout\cisout %
\advance\filecount by 1 %
\ifnum\filecount<5 %
\ifnum\the\filecount=1 \pgfplotstableread[col sep=comma]{data1.txt}{\main} \else\fi
\repeat %
}%
\section{pgfplotstable Test - bad}
%\pgfplotstabletypeset[col sep=comma]{\main}
\dots and some bad Omegas above\dots
\section{input Test - good}
\input{data1.txt}
\input{data3.txt}
\end{document}
\pgfplotstableread[col sep=comma,header=false]{data1.txt}{\main} \pgfplotstabletypeset[col sep=comma,string type]{\main}
works for me.\ifnum\the\filecount=1 \pgfplotstableread[col sep=comma]{data1.txt}{\main} \else\fi
is never going to be true as you start with filecount=1 and you increment it two lines above this test so it will never be less than 2.