I've a certain amount of inputfiles (.txt) for the final definition of the y-data of my axis environment. The x-data come from a different file. The goal is to sum up each row of the input files (necessary for my y-data) and multiply them by e.g -1.
So the files needed for my Y-data could look like the following:
\begin{filecontents}{n1b1_f1.txt}
2
3
\end{filecontents}
\begin{filecontents}{n1b2_f1.txt}
4
5
\end{filecontents}
\begin{filecontents}{n1b3_f1.txt}
6
7
\end{filecontents}
\begin{filecontents}{n1b4_f1.txt}
8
9
\end{filecontents}
And the file for the X-data like
\begin{filecontents}{X.txt}
1
2
\end{filecontents}
Now the final goal is to plot a x-y diagram with x(i)=X(i) and y(i)=(n1b1_f1(i)+n1b2_f1(i)+n1b3_f1(i)+n1b4_f1(i))*-1 where i gives the number of the current line.
The number of inputfiles needed for my y data could change, but not be greater than 9 and its now problem if I have to do this kind of adoptions 'manually'
I general I do not know the number of lines before. I would have to look them up, but it would be nice if it would work for any number i of lines automatically

