This command works well in a GNUplot script to find the line in a file with the value -1.98
system("/usr/bin/awk '/-1.98/{print $2 $1}' /path/to/myfile.txt")
Given the GNUplot variable STATS_min_y resulting from a plot command, how would I pass STATS_min_y into that system() call in place of the -1.98 value?
system("/usr/bin/awk '/STATS_min_y/{print $2 $1}' /path/to/myfile.txt")
and similar variants fail with a demand for a missing parenthesis.
system("/usr/bin/awk -v value=-1.98 '$0 ~ value {print $2 $1}' /path/to/myfile.txt")- fedorqui 'SO stop harming'system("/usr/bin/awk -v value= ". lowValue . " '$0 ~ value {print $2 $1}' /path/to/myfile.txt")in the sense that it recognizes the value of the variable (lowValue) but fails with this error:unknown option -1.98 ignored, and returns every line of the file. - Danvalue=. - Christoph