Created
September 21, 2011 03:54
-
-
Save jimsynz/1231205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat tim.csv | ruby -e 'STDIN.each { |l| @h ||= {}; n,v = l.split(","); v=v.to_f; @h[n] ? @h[n] += v : @h[n] = v }; @h.each { |n,v| puts "#{n},#{v}" }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tim | 150.00 | |
---|---|---|
James | 15.00 | |
Robert | 200.00 | |
James | 270.13 | |
Robert | 10.00 | |
Tim | 5.00 | |
Tim | 600.00 | |
James | 13.98 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment