Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90219

How do i use more than one delimiter?

$
0
0

So, i'm trying to create a way to convert a tsv file to csv, but already with tab "\t" and delimiter= '', there is a way of doing that?

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()`

Viewing all articles
Browse latest Browse all 90219

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>