I have a file with the contents:
6128 105
4356 15139
7052 1
5508 25
6932 200
5548 11468
5100 0
6128 105
4356 15125
7052 1
5508 25
6932 199
5548 11437
5100 0
Each of first number is repeated twice. For example there are 2 occurances of 6128, 4356, etc. What I want to do is subtract the second numbers for each first number. For example to achieve the output:
6128 0
4356 14
7052 0
5508 0
6932 1
5548 31
5100 0
Can anyone tell me how I might be able to do that with AWK?
Thanks!
6128 105
4356 15139
7052 1
5508 25
6932 200
5548 11468
5100 0
6128 105
4356 15125
7052 1
5508 25
6932 199
5548 11437
5100 0
Each of first number is repeated twice. For example there are 2 occurances of 6128, 4356, etc. What I want to do is subtract the second numbers for each first number. For example to achieve the output:
6128 0
4356 14
7052 0
5508 0
6932 1
5548 31
5100 0
Can anyone tell me how I might be able to do that with AWK?
Thanks!