I have the following script:
awk -F "," '{ if ( $4 > 450 && $4 < 550 && $5 > 0.5 ) print $2, $5; else print $2, "0" }' test.txt | awk '{a[$1]+=$2}END{for(i in a){print i, a}}' | sort -nk 1.2 | sed 1,2d
and a bunch of files that look like the test file attached here.
I am outputting all entries where the value meets the following parameters; $4 > 450 && $4 < 550 && $5 > 0.5
. Then I sort it and eliminate the first two rows. The scripts works well but I am pretty sure I can avoid using all the |
.
Any help will be greatly appreciated
PS. I am including my output file too