xlsx2csv icon indicating copy to clipboard operation
xlsx2csv copied to clipboard

Xlsx2csv always chooses the first worksheet

Open brand17 opened this issue 2 years ago • 2 comments

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.

brand17 avatar Sep 02 '22 13:09 brand17

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)

mrRobot62 avatar Oct 05 '22 13:10 mrRobot62

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")

mrrcollins avatar Dec 11 '23 17:12 mrrcollins