pythonでtsvをcsvに変換
code:py
import csv
tsv_files=[
'なんか適当なログ.log',
]
for tsv_file in tsv_files:
tsv_f = open(tsv_file, 'r')
tsv = csv.reader(tsv_f, delimiter = '\t')
with open(tsv_file + '.csv', 'w', newline="") as csv_f:
writer = csv.writer(csv_f, delimiter=",")
for row in tsv:
writer.writerow(row)
csv_f.close()
tsv_f.close()