Created
November 22, 2013 11:38
-
-
Save nsonnad/7598574 to your computer and use it in GitHub Desktop.
Python script for converting tsv to csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Is it interactive? (in other words, how would you declare where is the input file?)
@danyaljj you could do this:
python tsv2csv.py < file_input.tsv > file_output.csv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would you use this?