I have the following problem:
I want to use a loop to plot data from different files (named
file1.dat, file2.dat, ... in this example) in just one output-plot. I use this in a shell script to do so:
plot for [i=1:6] u 1:2 'file'.i.'.dat'
Now I additionally want to only plot a certain range of lines from each file. To do this I learned to use:
plot "<(sed -n '1,100p' file.dat)" u 1:2
Anyhow, if I want to combine these two like:
plot for [i=1:6] "<(sed -n '1,100p' file'.i.'.dat)" u 1:2
i within the expression giving the filename
sed cannot be interpreted as the variable
i. The error I get is:
sed: can't read file_.i..dat: No such file or directory
Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?