SPAWN with AWK [message #83563] |
Sat, 09 March 2013 01:38 |
hannah_ue
Messages: 14 Registered: November 2012
|
Junior Member |
|
|
Hi there,
I have to read in a lot of data files in my IDL script and thought about using SPAWN with AWK for this. So far, I did it with READCOL and WHERE functions but I find it kind of convenient to do it with just one line in AWK (but I have no idea of the efficiencies, if someone could say anything to this..).
No I have some problems with my command, as there are to many ". The line looks like this:
spawn, "awk '{if (min=="") {min=max=$17}; if ($17>max) {(max=$17) && (maxid=$1)}; if (($17<min) && ($17!=0.)) {(min=$17) && (minid=$1)}} END {print min, minid, max, maxid}' dat file" val_vec
Not surprisingly, I get an "unterminated string" error bec of the "s at (min==""). So my question is, if anyone has an idea to fix this either in the awk command or anyhow in IDL.
Thanks for your help!
Hannah
|
|
|