Skip to content

Instantly share code, notes, and snippets.

@vsimko
Created May 10, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsimko/7b8ed86419943625a0368d02390a3b29 to your computer and use it in GitHub Desktop.
Save vsimko/7b8ed86419943625a0368d02390a3b29 to your computer and use it in GitHub Desktop.
# convert ";" to ","
tr ";" "," < input.csv > output.csv
# list of columns with associated numbers
head -1 commadata.csv | tr ',' '\n' | nl
# project columns 1,2,163-174 into a new file
cut -d',' -f 1,2,163-174 commadata.csv > SOC.csv
# random subsample of 100 rows (not tested)
sort -R input.csv | head -100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment