I have a textfile with:
1 100 2 80 3 70 4 64
Now I need another file that contains the first column equal to above and the second column should be the difference of to consecutive values of the above file, i.e.:
1 20 2 10 3 6
What is the most elegant/easy way to accomplish this with unix commands? What changes if I do not need a second file, but just have a third column in the original file with the desired differences.
Thanks a lot!