filter rows based on filtering two different columns
Hello,
I am trying to print out rows that would match a particular filtering criteria on two columns: Simple matrix: sample1 0 0 4 sample2 0 0 10 sample3 0 0 15 sample4 0 0 20 sample5 3 2 3 I would like to print out rows where column 2==3 and column 4 <20. This will print out the last row only. is this possible in awk? I understand how to apply one column filter but how to apply a two column filter: this works so far; awk '$4<20 {print $0}' simplematrix.txt I tried: awk '$4<20 & $2==3 {print $0}' simplematrix.txt and I get a syntax error. Anyone help?? |
Code:
awk '$4<20 && $2==3 {print $0}' jenbarbsmith.txt |
Thanks a bunch! Just found the correct syntax on the web too. Appreciate the fast reply!
|
All times are GMT -5. The time now is 11:48 PM. |