Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xlsx2csv always chooses the first worksheet #239

Open
brand17 opened this issue Sep 2, 2022 · 2 comments
Open

Xlsx2csv always chooses the first worksheet #239

brand17 opened this issue Sep 2, 2022 · 2 comments

Comments

@brand17
Copy link

brand17 commented Sep 2, 2022

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.

@mrRobot62
Copy link

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)

@mrrcollins
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants