linux - Gawk not working correctly in finding min between 3 lines -
i have following gawk script: begin{ count = 0 imp = "" time = 0 } { if(count==0){ imp = $0 time = $7 count = 1 } else if(count==1 || count==2){ if($7 < time){ imp = $0 time = $7 } count+=1 } else{ count=0 print imp } } and bunch of files this: 1 57 0.850000 0.000010 0.784696 0.114561 0.670135 1 57 0.850000 0.000010 0.783619 0.114349 0.669270 1 57 0.850000 0.000010 0.725526 0.114805 0.610721 2 57 0.850000 0.000010 1.590584 0.102643 1.487942 2 57 0.850000 0.000010 1.291972 0.076006 1.215967 2 57 0.850000 0.000010 1.224136 0.063005 1.161131 4 57 0.850000 0.000010 0.679327 0.062899 0.616428 4 57 0.850000 0.000010 0.680867 0.062456 0.618411 4 57 0.850000 0.000010 0.684800 0.063411 0.621389 8 57 0.850000 0.000010 0.374985 0.063619 0.311367 8 57 0.850000 0.000010 0.401494 0.062838 0.338655 8 57 0.850000 0.000010 0.405216 0.064353 0.340...