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

Unable to handle hidden rows when attribute value of 'hidden' is 'true' in some xlsx files #266

Open
rockc2020 opened this issue Aug 31, 2023 · 0 comments

Comments

@rockc2020
Copy link

When I run xlsx2csv against some xlsx files, found hidden rows are exported to the csv files even if the parameter skip_hidden_rows is true by default.

After digging into it a bit, I noticed those xlsx files have set the attribute value of hidden to true instead of 1 as some others. This caused the condition checking code here not filtering the hidden row out.

        elif self.in_sheet and (name == 'row' or (has_namespace and name.endswith(':row'))) and ('r' in attrs) and not (self.skip_hidden_rows and 'hidden' in attrs and attrs['hidden'] == '1'):

Here is an example xlsx file attached which is exported from Lark docs (https://www.larksuite.com/en_us/product/creation?from=hero_section)
feishu_test_hidden_rows.xlsx

Here are the hidden row attributes from xlsx files exported from MS Excel and Google Docs:

row {'r': '3', 'hidden': '1'}

Here are the hidden row attributes from xlsx files exported from larksuite:

row {'customHeight': 'true', 'hidden': 'true', 'ht': '19', 'r': '2'}

Let me know if you'd like to include it. If yes, I'd be happy to raise a PR for it.

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

1 participant