I have the following space-delimited input:
1 11.785710 117.857100
1 15 150
1 20 200
1 25 250
3 2.142855 21.428550
3 25 250
22 1.071435 10.714350
The first field is the ID number, the second field is the percentage of the total points that the person has and the third column is the number of points they earn. I need to "merge" all of the records that have the same ID number. So, the output should be:
1 71.785710 717.857100
3 27.142855 271.428550
22 1.071435 10.714350
basically it's just adding the columns together of the rows with the same number in column 1. I tried a couple of different things using awk and arrays, but I can't seem to figure this one out.
Please help -- thank you