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
Remember the old values (from the previous row).
awk 'NR > 1 { print $1 - old1, $2 - old2 } { old1 = $1; old2 = $2 }' data.file
You can try this,
awk 'NR==1{col1=$1; col2=$2;} { print $1-col1,$2-col2; col1=$1;col2=$2}' yourfile