Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python script for converting tsv to 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)
@danyaljj

This comment has been minimized.

Copy link

danyaljj commented Oct 26, 2017

How would you use this?

@danyaljj

This comment has been minimized.

Copy link

danyaljj commented Oct 26, 2017

Is it interactive? (in other words, how would you declare where is the input file?)

@Ironjanowar

This comment has been minimized.

Copy link

Ironjanowar commented Jul 16, 2018

@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
You can’t perform that action at this time.