Get all rows having a column value greater than a threshold

awkgrepnumeric datatext processing

I have a file with a lot of rows and columns but the number of columns are not same in all rows. I want to extract all rows having delta value greater than 0.02

Point          Fanout   cap   trans   delta   incr   Path
----------------------------------------------------------
row1             1       0.02  0.01   0.00     0.03   0.04
row2             2       0.04
row3             1       0.01  0.02    0.04    0.05   0.06
row4                     0.03
row5                           0.04     0.05    0.07  0.07

Can anybody help? How to grep all those rows and corresponding delta value?

Best Answer

As pointed out in comments, for a delimiter other than space (i.e tab as seems to be your case) bellow solutions would work ok.
If delimiter is space bellow solutions will not work. You need to clarify what is the real fields separator.

awk -F"\t" '$5>0.02' file
#or
awk -F"\t" 'NR==1{print;next}$5>0.02' file #to keep the header
#or
awk -F"\t" 'NR==1 || $5>0.02' file  #also keeps header as advised in comments
#or 
awk -F"\t" 'NR<=2 || $5>0.02' file   #keep header and dashed row bellow header as advised by @Sundeep 

If you are in doubt about the format of the numeric values, you could even try

awk -F"\t" '($5*1)>0.02' file
Related Question