Skip to content

Instantly share code, notes, and snippets.

@nsonnadsnip
Forked from nsonnad/tsv2csv.py
Created November 29, 2013 10:26
Show Gist options
  • Save nsonnadsnip/7703951 to your computer and use it in GitHub Desktop.
Save nsonnadsnip/7703951 to your computer and use it in GitHub Desktop.
python: convert a tsv to a csv
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment