Created
June 5, 2015 13:04
-
-
Save whyvez/fcdacf015cee8ec694c2 to your computer and use it in GitHub Desktop.
pgyi swap ds company
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
| COMPANY=TSI; mkdir -p $COMPANY; for csv in *.csv; do awk -F, -v COMPANY=$COMPANY 'NR > 1 {OFS=","; $1=COMPANY}1' $csv > ./$COMPANY/$csv; done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage: cd into a directory that has csv files with a company field and run.
outcome: will create a new directory for the $COMPANY passed in that contains the same csv file with the company changed to $COMPANY. TSI in this case