You might need a quick script to convert between tab separated to comma separated text files.

Here's how…

Convert between tab separated to comma separated

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)

Convert between comma separated to tab separated

import sys
import csv

commain = csv.reader(sys.stdin, dialect=csv.excel)
tabout = csv.writer(sys.stdout, dialect=csv.excel_tab)
for row in commain:
  tabout.writerow(row)

Usage and credits

run this with the following syntax:

python script.py < input.file > output.file

Adopted and adjusted from StackOverFlow

convert_between_comma_separated_to_tab_separated_text_files.txt · Last modified: 2012/01/08 16:25 by filination
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki