You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just like the documentation says, Close closes and cleanup the open temporary file for the spreadsheet, so you should not read any data after called it.
Description
当excel文件内容较少时,比如只有几行数据,文件大小十几或几百KB,在下面函数GetRowIterator中是否file.Close,对main中行读取/打印结果没有影响。
但是当excel文件70MB时,上万行数据,GetRowIterator中是否file.Close会对main函数中数据读取/打印结果有着不一样的结果。
Steps to reproduce the issue:
在读取70MB文件时:
Describe the results you received:
Describe the results you expected:
excel只有一个sheet,一万多行四列数据。
当注释掉GetRowIterator中defer file.Close()时:可以正常打印excel每行的内容。不像上面没注释时打印只有索引值。
出现这种情况,是为什么呢?是因为对于大文件file.Close会清除内容,对于返回的*excelize.Rows打印每一行只有索引值吗?
但是对于小文件行数少时,是正常的,是否在GetRowIterator中执行file.Close都没有影响,这是为什么呢?
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):: windows, mac都试过出现此问题
The text was updated successfully, but these errors were encountered: