Skip to content

Instantly share code, notes, and snippets.

@swinton
Created February 28, 2011 14:34
Show Gist options
  • Select an option

  • Save swinton/847390 to your computer and use it in GitHub Desktop.

Select an option

Save swinton/847390 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import csv
def tsv_to_csv(filename="data.tsv", output="data.csv"):
f = open(filename)
out = csv.writer(open(output, "wb"))
for line in f:
out.writerow(line.strip().split("\t"))
f.close()
if __name__ == "__main__":
tsv_to_csv()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment