Created
November 3, 2010 01:52
-
-
Save thepaul/660680 to your computer and use it in GitHub Desktop.
index records by first field and output according to that index. original need called for commas, but set VSEP to the empty string if you just want separation of multiple values with OFS.
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
awk '{x[$1]=x[$1]?(x[$1] VSEP OFS $2):$2}END{for(e in x){print e,x[e]}}' VSEP=, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment