Unable to fetch rows of a sheet with more than 31 characters in its name.
Description Unable to fetch a sheet with more than 31 characters in its name.
I know this is not supported by Microsoft Excel but this issue prevents a user from handling xlsx files produced by other tools (LibreOffice or Google Sheets).
The reason for this is in File.Rows() when getting the sheet from f.sheetMap (see github.com/360EntSecGroup-Skylar/excelize/rows.go:151).
The problem here is that f.sheetMap has the original sheet name but we're trying to find it via the truncated sheet name (trimSheetName(sheet)). Naturally, this may not be possible when the sheet name doesn't respect the 31 character limit.
#249 (closed) mentions something about 31 characters, but I don't understand Chinese so I cannot be sure if it's related at all.
Steps to reproduce the issue:
- Download this zip
- Extract the
xlsxand thegofile. - Run the go file:
go run main.go
Describe the results you received: Excelize cannot find the sheet "abcdefghijklmnopqrstuvwxyz0123456789"
$ go run main.go
Err is nil: false
sheet abcdefghijklmnopqrstuvwxyz0123456789 is not exist
Describe the results you expected: I expected the sheet "abcdefghijklmnopqrstuvwxyz0123456789" to be found.
$ go run main.go
Err is nil: true
nil
Output of go version:
go version go1.13.5 linux/amd64
Excelize version or commit ID:
5f3a4bc39f9cf2987104ffe57242a0526cdd9158
Environment details (OS, Microsoft Excel™ version, physical, etc.): Linux