Hi -
You would also help yourself (if only for debugging purposes) to separate out a) building the command text, from b) actually running the command text.
Because the text you generate may - or may not be - the text you're expecting:
Code:
import java.io.*;
public class Test
{
public static void main (String[] args)
{
int meCounter = 10;
String sCmd = "gawk '{if($4>0.9) print $3}' A261u_" + meCounter + ".cat > tmp.dat";
System.out.println ("sCmd=" + sCmd + "...");
Process p = Runtime.getRuntime().exec (sCmd);
}
}
Quote:
sCmd=gawk '{if($4>0.9) print $3}' A261u_10.cat > tmp.dat...
|
At this point, you'd probably:
a) Make sure "A261u_10.cat" is the file you want
b) Make sure column 4 contains a valid number
c) Make sure column 3 contains valid data
d) Make sure the previous invocation didn't overwrite your "tmp.dat"
e) etc etc
You might also want to verify that your JVM's $PATH contains "gawk".
'Hope that helps .. PSM