Consider the below file:
foo,boo,900
foo,boo,900
foo,boo,850
I need to compare the a field ($3
) with the next record, if the difference is equal or more than 50, then print the record.
i.e from the sample above, $3
from second record – $3
from the third record = 50, then the output would be:
foo,boo,850
Best Answer
You can try this
awk
and this one if you don't want to print row if filed
$1
changed: