Skip to content

Instantly share code, notes, and snippets.

@dwillis
Created April 1, 2011 20:15
Show Gist options
  • Save dwillis/898775 to your computer and use it in GitHub Desktop.
Save dwillis/898775 to your computer and use it in GitHub Desktop.
# convert.py
import sys
import csv
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tabin:
commaout.writerow(row)
# run like so: python convert.py < input.tsv > output.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment