因此,我正在尝试创建一种将tsv文件转换为csv的方法,但是已经使用制表符“ \ t”和delimiter ='', 有办法吗?
from xlsxwriter.workbook import Workbook
tsv_file = '1.tsv'
xlsx_file = '1.xlsx'
workbook = Workbook(xlsx_file)
worksheet = workbook.add_worksheet()
tsv_reader = csv.reader(open(tsv_file,'rt'),delimiter="\t")
for row, data in enumerate(tsv_reader):
worksheet.write_row(row, 0, data)
workbook.close()`