From: alexgm24 <ale...@ho...> - 2007-11-30 19:33:38
|
Hi, I want to get a single value from a data file to use it as a constant: a = "this value is the one that is in the file.data" And then I want to plot the column 2 * this value.I have so many data files to do an script for each one. plot "file.dat" using 1:($2*a) Any idea? Thanks in advance. -- View this message in context: http://www.nabble.com/gnuplot%2C-get-single-value-tf4923819.html#a14090966 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
From: <HBB...@t-...> - 2007-12-01 19:23:00
|
alexgm24 wrote: > Hi, > I want to get a single value from a data file to use it as a constant: So write yourself a script that takes the file name, and parameters describing the position of that value, as command line arguments. Do it in what ever scripting language you like. Then read "help substitution" in gnuplot. |
From: alexgm24 <ale...@ho...> - 2007-12-04 23:28:18
|
Finally I have found one way to do that with cat and awk: a=`cat -n file.data | awk '{if ($1 == 13) print $8}'` This way I get the value in the line 13 and columm 7 Hope usefull for some one else. alexgm24 wrote: > > Hi, > I want to get a single value from a data file to use it as a constant: > > a = "this value is the one that is in the file.data" > > And then I want to plot the column 2 * this value.I have so many data > files to do an script for each one. > > plot "file.dat" using 1:($2*a) > > Any idea? > Thanks in advance. > -- View this message in context: http://www.nabble.com/gnuplot%2C-get-single-value-tf4923819.html#a14161460 Sent from the Gnuplot - User mailing list archive at Nabble.com. |