I have a tab delimited file (no header) and I’d like to take the difference of column 3 and 2, and then add them all together.
Ie,
col1\tcol2\tcol3\tcol4
hi\t10\t100\t0.4
bye\t150\t400\t5.6
The result would be: (100-10)+(400-150)=340
How would I do such operation one-line using awk?
Thanks.
1 Answer