Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

readRowsFromSheet does not handle case where row number is missing #853

@mrog

Description

@mrog

In lib.go, the function readRowsFromSheet assumes that the raw row always has a row number. However, the row number is optional according to ECMA-376 5th edition. See the definition of CT_ROW in part 1, appendix 2.

I receive spreadsheets where the row number is missing from the first row. This causes the first row of data to have an index of -1 instead of 0. Then the second row has an index of 1. When row 0 is requested using the library, a blank row is returned.

This could be fixed by adding a check here. For the first row, if rawrow.R is 0, then row.num should be 0.

The file spec isn't clear about how to handle subesquent rows without row numbers. I suppose the code could simply add 1 to the previous row number when rawrow.R is 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions