xlsx2csv
xlsx2csv copied to clipboard
Xlsx2csv always chooses the first worksheet
I am trying:
from xlsx2csv import Xlsx2csv
Xlsx2csv('Book1.xlsx', sheet_name='Sheet2').convert('myfile.csv')
But it always saving the first worksheet.
Tried versions 0.8.0
and 0.7.8
. My python version is 3.10.5 64-bit
.
an easy workaround is to try this :-)
This example load the 2nd sheet from Book1.xlsx
Xlsx2csv('Book1.xlsx', sheet_id=2).convert('myfile.csv',sheet_id=2)
Sheets are numbered up from 1 to n. Try to use id's instead of real sheet name. That works on my side with 0.7.4 (btw: this version contains the same error as your discribed)
I looked at the source, the format is slightly different. This worked for me where the sheet name was updates
Xlsx2csv("updates.xlsx").convert("updates.csv",sheetname="updates")