-
-
Save yfwu/9a33a899a4ec0b45c7120274087c60e0 to your computer and use it in GitHub Desktop.
tsv2csv
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 csv | |
# he underlying Windows text file mechanism cuts in and changes that \n to \r\n ... total effect: \r\r\n | |
# Refs: http://stackoverflow.com/questions/1170214/pythons-csv-writer-produces-wrong-line-terminator/1170297#1170297 | |
with open('AllNet5.csv', 'w') as out: | |
reader = csv.reader(open('AllNet5.net', 'r'), delimiter="\t") | |
for row in reader: | |
out.write(','.join(row) + '\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment