Created
March 17, 2022 16:17
-
-
Save keyan/c0ba61ceffcaa462c02ee0e20348795d to your computer and use it in GitHub Desktop.
awk command to comma-delimited group second column based on value of first column
This file contains hidden or 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 '{if(a[$1])a[$1]=a[$1]", "$2; else a[$1]=$2;}END{for (i in a)print i, a[i];}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment