If 2 lines after the line with "AA", $3 of the line is > 80(here 89 so yes) , I want to cat the line with "AA" and "CC".
aaaaaaaa AA [15]
bbbbbbbb BB [60]
cccccccc CC [89]
dddddddd DD [52]
I tried this :
gawk '{for (I=1;I<NF;I++) if ($I == "AA" && $I+2 > 80) print $I,$I+2}' ~/Desktop/toto.txt
output desired :
aaaaaaaa AA [15]
cccccccc CC [89]
Thank you for your help