Created
May 20, 2015 17:54
-
-
Save pallymore/6c7e2d31f56ab4dcb07c to your computer and use it in GitHub Desktop.
awk command to split csv file by uniq values in the 5th column
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 -F, 'NR==1{hdr=$0;next}!($5 in files){files[$5]=1;print hdr >$5".csv"}{print>$5".csv”}’ input.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment