Skip to content

Instantly share code, notes, and snippets.

@jjfiv
Created November 15, 2013 21:04
Show Gist options
  • Select an option

  • Save jjfiv/7491576 to your computer and use it in GitHub Desktop.

Select an option

Save jjfiv/7491576 to your computer and use it in GitHub Desktop.
TSV to CSV
import sys
with open(sys.argv[1],'r') as fp:
for line in fp:
if "\t" not in line:
continue
cols = [col.strip('"').strip() for col in line.rstrip().split("\t")]
print(','.join(cols))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment