Skip to content

Instantly share code, notes, and snippets.

@bycoffe
Created September 14, 2009 17:00
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 bycoffe/186772 to your computer and use it in GitHub Desktop.
Save bycoffe/186772 to your computer and use it in GitHub Desktop.
"""
Like cut, but for CSVs. To be used from a shell command line.
Change row[1] to the row index to be printed. row[1] will print the second
item in the row.
"""
python -c 'import sys, csv
for row in csv.reader(sys.stdin):
print row[1]' < filename.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment