Need to retain particular rows

Hi All,
I am in need of help to retain particular rows. I have a large file with 5 columns. Column 3 has signs like �=� �>� �<� and column 5 has values �nm� �%� or empty space.
I need to keep only rows which have �=� in column 3 and �nm� in column 5. How can I do it in awk? Any help is greatly appreciated.

cat File1:

Column1          Column2          Column3          Column4          Column5
123                  value                =                      10                    nm
1553                value                =                      10                    nm
1233                value                >                      50                    nm
1623                value                =                      20                    %
1128                value                =                      60                    
175                  value                =                      60                    nm

Needed Output:

Column1          Column2          Column3          Column4          Column5
123                  value                =                      10                    nm
1553                value                =                      10                    nm
175                  value                =                      60                    nm

Thanks in advance
NP

nawk 'NF==5 && $3=="=" && $NF=="nm"' File1
1 Like
awk '$3=="=" && $5=="nm" {print}' infile

Edit (improvement):

awk '$1=="Column1" || $3=="=" && $5=="nm"' infile
1 Like

vgersh99, pseudocoder, Thanks a lot... Both works nicely....