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

多个sheet栏位解析错误 #93

Open
AncestorDragon opened this issue May 9, 2024 · 0 comments
Open

多个sheet栏位解析错误 #93

AncestorDragon opened this issue May 9, 2024 · 0 comments

Comments

@AncestorDragon
Copy link

.xls文件存在多个sheet栏位

例如想解析sheet2栏位
if xlFile, err := xls.Open(filePath, "utf-8"); err == nil {
//第一个sheet
sheet := xlFile.GetSheet(1)
fmt.Println(sheet.Name)
fmt.Println(sheet.MaxRow)
}

打印:
Sheet2
6
这看起来没什么问题,然而只是多加了一句代码输出行数据时,整个sheet获取就会错乱

if xlFile, err := xls.Open(filePath, "utf-8"); err == nil {
//第一个sheet
sheet := xlFile.GetSheet(1)
fmt.Println(sheet.Name)
fmt.Println(sheet.MaxRow)
row := sheet.Row(0)
fmt.Println(row)
}
打印:
Sheet1
13730
&{0xc0093f4000 0xc0089d4630 map[0:0xc0089d4ae0 1:0xc0089ded80]}

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