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

Incorrect reading of data with empty cells when used with pyexcel. #8

Open
qria opened this issue Feb 2, 2022 · 0 comments
Open

Incorrect reading of data with empty cells when used with pyexcel. #8

qria opened this issue Feb 2, 2022 · 0 comments

Comments

@qria
Copy link

qria commented Feb 2, 2022

Summary

Reading an xlsx file with empty cell results in a misaligned reading.

Expected Behaviour

Input

image

Expected

> pyexcel.get_sheet(file_name="messy2.xlsx")

Sheet1:
+-----+-----+-----+
| a   | b   | c   |
+-----+-----+-----+
| 1.0 | 2.0 |     |
+-----+-----+-----+
|     | 2.0 | 3.0 |
+-----+-----+-----+
| 4.0 | 5.0 |     |
+-----+-----+-----+

Actual Result

> pyexcel.get_sheet(file_name="messy2.xlsx")

Sheet1:
+-----+-----+---+
| a   | b   | c |
+-----+-----+---+
| 1.0 | 2.0 |   |
+-----+-----+---+
| 2.0 | 3.0 |   |
+-----+-----+---+
| 4.0 | 5.0 |   |
+-----+-----+---+

Skimming the code it looks like pyexcel-xlsxr incorrectly assumes that data is already aligned.

FYI <sheetData/> part of the sheet xml looks like follows:

<row r="1">
    <c r="A1" s="1" t="s"><v>0</v></c>
    <c r="B1" s="1" t="s"><v>1</v></c>
    <c r="C1" s="1" t="s"><v>2</v></c>
</row>
<row r="2">
    <c r="A2" s="1"><v>1.0</v></c>
    <c r="B2" s="1"><v>2.0</v></c>
</row>
<row r="3">
    <c r="B3" s="1"><v>2.0</v></c>
    <c r="C3" s="2"><v>3.0</v></c>
</row>
<row r="4">
    <c r="A4" s="1"><v>4.0</v></c>
    <c r="B4" s="1"><v>5.0</v></c>
</row>
@qria qria changed the title Incorrect reading of data with empty cell. Incorrect reading of data with empty cells. Feb 2, 2022
@qria qria changed the title Incorrect reading of data with empty cells. Incorrect reading of data with empty cells when used with pyexcel. Feb 2, 2022
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