|
From: atoms.h <tho...@gm...> - 2014-05-20 13:33:51
|
Hi all,
i have a strange problem regarding string variables and iterations. What I'd
like to do is to handle operations for several input files in a loop:
$ list = "file1.dat file2.dat file3.dat ..."
$ item(n) = word(list,n)
$ do for [i = 1 : words(list)]{
$ file = item(i)
$ total = `echo $(awk '/Total/ {print $4}' @file)`
$ }
This always complains that 'file' is not a string (for the awk command).
Outside the loop, however, it works:
$ list = "file1.dat file2.dat file3.dat ..."
$ item(n) = word(list,n)
$ do for [i = 1 : words(list)]{
$ file = item(i)
$ }
$ total = `echo $(awk '/Total/ {print $4}' @file)`
So there seems something strange is happening in the loop which I don't
quite understand. Like if the awk command would be executed first or
something...
If anyone has some inside or better idea I would very much appreciate it!
Kind regards,
Thomas
--
View this message in context: http://gnuplot.10905.n7.nabble.com/string-variables-and-iteration-tp18434.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|