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的迭代器会直接跳过循环 #297

Open
wangguanquan opened this issue Oct 21, 2022 · 3 comments
Open

sheet的迭代器会直接跳过循环 #297

wangguanquan opened this issue Oct 21, 2022 · 3 comments
Labels

Comments

@wangguanquan
Copy link
Owner

我这边还有个问题,使用sheet的迭代器,发现我有一份文件无法读取,会直接跳过循环,不进入循环体。当我添加代码里注释的那一行,又能进入循环了,其它的excel文件能正常读取
很抱歉我无法提供原始数据,这份数据打开看都是正常的。想请教下,之前有遇到这种问题吗?或者怎么才能找到这份文件和其它文件的不同?谢谢

try (ExcelReader excelReader = ExcelReader.read(Paths.get(filePath))) {
            
//        excelReader.sheet(0).dataIterator().hasNext();

            for (Iterator<Row> ite = excelReader.sheet(0).dataIterator(); ite.hasNext(); ) {
                String oneLine = ite.next().toString();
                System.out.println(oneLine);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

Originally posted by @zhangwx95 in #296 (comment)

@wangguanquan
Copy link
Owner Author

@zhangwx95 in #296 (comment)

@zhangwx95
Copy link

抱歉之前弄别的去了,想起来这个问题
已更新至0.5.5
仍跳出循环 有效范围仍然是 A1:A46152
好像还是有点问题

@wangguanquan
Copy link
Owner Author

请问“有效范围仍然是 A1:A46152”是如何获取的?文件是xls还是xlsx格式?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants