I have a file of the format
A 3
A 5
A 6
B 3
B 3
B 4
C 5
C 7
C 2 etc.
What I'd like to do is add up all the values in the second column that correspond to each unique identifier in the first column. Unfortunately the file is too large to specify each identifier individually so I need something that goes through each line in the file but only outputs each identifier along with its sum total.
I'd be grateful for any guidance you could offer.
Best wishes
A 3
A 5
A 6
B 3
B 3
B 4
C 5
C 7
C 2 etc.
What I'd like to do is add up all the values in the second column that correspond to each unique identifier in the first column. Unfortunately the file is too large to specify each identifier individually so I need something that goes through each line in the file but only outputs each identifier along with its sum total.
I'd be grateful for any guidance you could offer.
Best wishes