Hello all!
Here's my question -> I have about 6000 files each with 9 columns, each columns containing about 2000+ rows. So, lots of data!
I have been able to successfully grab the 3 values that I need to extract from 1 file and to write those 3 values into an output.txt file.
I now need to be able to somehow get awk to accept multiple input files to do the same for the remaining 5999 files and write the 3 values it grabs to the SAME output.txt file. This would mean that by the end of it, I end up with 1 output.txt file with 3x6000 numbers in 3 neat columns.
I know that awk can accept multiple files in the following way: awk ’program’ input-file1 input-file2 etc. But clearly I can't write the 6000 names out manually.
Does anyone know of a smart way to tell it "Apply awk program from file Data00001.dat to Data06831.dat"
Thank you!
#!/usr/bin/gawk -f
BEGIN {
inSpill=0;
outSpill=0;
}
// {
if (($8>3000000)&&(inSpill==0)) {
inSpill=1;
start=$5
}
if (($8>10000000)&&(outSpill==0)) {
outSpill=1;
end=$5
}
lastRead=$5
}
END {
NumCoincParticles=(end-start);
percentage = NumCoincParticles/end;
print NumCoincParticles" "percentage" "lastRead" "start" "end;
}