My example goes like that:
FILE_A
ABC spring 14 60
FILE_B
ABC
I want to print FILE_A if first column matches FILE_B first column && second column is "spring".
awk 'NR==FNR {a[$1]=$1;next} ; {if ($4=="spring" && $5 in a) {print $0}' FILE_B FILE_A
This works fine, but if I want to add condition if 60-(14-60)>0 I can't get it.
I tried if ($4=="spring" && $4-($3-$4)>0 && $5 in a), but I can't get it work.
My question is:
How to make awk if conditions with "in an array" condition?