Closed jsd3 closed 5 months ago
Hi @jsd3. Thanks for opening this issue.
It's a while since I've worked on this, but I think the issue could be that the cells you get back in each row don't necessarily include empty cells - they instead rely on you working out which Column it belongs to.
type Cell struct {
Column string // E.G A, B, C
Row int
Value string
Type CellType
}
There is a ColumnIndex
helper if you're looking for the column number though:
// ColumnIndex gives a number, representing the column the cell lies beneath.
func (c Cell) ColumnIndex() int {
return asIndex(c.Column)
}
Hope this helps.
I have a spreadsheet (attached) that has 81 columns, yet some of the rows read only 79 or 80 columns . I have tried Excelize and it also has the same trouble with two of the spreadsheet columns when the cells are empty (see the columns "Customer request date" and "Target date" and the last two rows in the attached spreadsheet).
Here is some code for reading the file and seeing the problem:
xl, err := xlsxreader.OpenFile("")
The xml in the file appears ok from manual examination. As an aside, I also tried parsing with NodeJS and one library fails similarly, but another works just fine.
It is a bit of a puzzle and I'd love to see a fix or explanation for the problem! If it can be solved that would make this module absolutely amazing and a critical piece of functionality I have to deliver.
sample_parse_failure.xlsx
Thanks so much for any help!