Skip to content

Instantly share code, notes, and snippets.

@cdolek
Last active June 2, 2017 20:43
Show Gist options
  • Save cdolek/5670945111115fedb7ae420b4dcd8757 to your computer and use it in GitHub Desktop.
Save cdolek/5670945111115fedb7ae420b4dcd8757 to your computer and use it in GitHub Desktop.
Shell - get nth column of a csv file
# Get 2nd column of a csv file
awk -F "\"*,\"*" '{print $2}' sourceFile.csv > targetFile.csv
# Or
awk -F "," '{print $1}' someOtherSourceFile.csv > new.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment