pbnjay / grate

A Go native tabular data extraction package. Currently supports .xls, .xlsx, .csv, .tsv formats.
MIT License
137 stars 22 forks source link

[bug fix] formula parse error #15

Closed la-chemin closed 9 months ago

la-chemin commented 9 months ago

replace xls/sheets.go

250 xnum := binary.LittleEndian.Uint64(fdata[6:])

with 250 xnum := binary.LittleEndian.Uint64(fdata[0:])

would fix

pbnjay commented 9 months ago

Looking at the code history for that line I believe you, but can you provide an example file so I can verify this?

la-chemin commented 9 months ago

here is my test file testFile.xls

and the test code follows: ` package main

import ( "fmt" "github.com/pbnjay/grate" _ "github.com/pbnjay/grate/xls" )

func main() { xlsFile, err := grate.Open("testFile.xls") if err != nil { fmt.Println("open xls failed", err) return } sheets, := xlsFile.List() for , sheetName := range sheets { fmt.Println(sheetName) sheetObj, _ := xlsFile.Get(sheetName) for sheetObj.Next() { fmt.Println(sheetObj.Strings()) } }

}`