I am very new in Awk. I want to calculate the difference between first row column2 and second row column2. For instance:
Num1 Num2
23 26
34 39
43 58
63 61
So, I want to calculate from Column (Num1) 34-23, 43-34, 63-43. And same for column(Num2). Can you please help me. I can only calculate the value within rows which is $1 - $2
, but not within column.
You can try this,
Remember the old values (from the previous row).