7 edited tags
| link
    Post Reopened by don_crissti, Stephen Rauch, Jeff Schaller, Stephen Kitt, xhienne
6 deleted 51 characters in body
source | link

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

clearly the i within the expression giving the filename file'.i.'.dat to sed cannot be interpreted as the variable i. The error I get from a minimal example is:

awk: fatalsed: cannot opencan't fileread `file_file_.i..dat' for readingdat: (No such file or directory)

Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?

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

clearly the i within the expression giving the filename file'.i.'.dat to sed cannot be interpreted as the variable i. The error I get from a minimal example is:

awk: fatal: cannot open file `file_.i..dat' for reading (No such file or directory)

Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?

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

clearly the i within the expression giving the filename file'.i.'.dat to 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?

5 added 230 characters in body
source | link

I have the following problem: 

I want to use a loop to plot data from different files (named file1.dat, file2.dat, ... in gnuplot, such asthis 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'

But know with the additional taskNow I additionally want to only plot a certain range of lines, where 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

clearly the i within the expression ingiving the filename file'.i.'.dat to sed cannot interpretbe interpreted as the variable i. The error I get from a minimal example is:

awk: fatal: cannot open file `file_.i..dat' for reading (No such file or directory)

Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?

I have the following problem: I want to use a loop in gnuplot, such as:

plot for [i=1:6] u 1:2 'file'.i.'.dat'

But know with the additional task to only plot a certain range of lines, where I learned to use:

plot "<(sed -n '1,100p' file.dat)"  u 1:2

Anyhow, if I want to combine these two:

plot for [i=1:6] "<(sed -n '1,100p' file'.i.'.dat)"  u 1:2

clearly the expression in ... cannot interpret the variable i. The error I get is:

awk: fatal: cannot open file `file_.i..dat' for reading (No such file or directory)

Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?

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

clearly the i within the expression giving the filename file'.i.'.dat to sed cannot be interpreted as the variable i. The error I get from a minimal example is:

awk: fatal: cannot open file `file_.i..dat' for reading (No such file or directory)

Do you have any suggestions how to circumvent this problem or other approaches to achieve my goal?

    Post Closed as "unclear what you're asking" by Stephen Rauch, Scott, Anthon, Satō Katsura, muru
4 deleted 25 characters in body
source | link
3 Markup.
source | link
2 edited tags
| link
1
source | link