我可以使用sheet.getRows()来计算excel文档中的行数;但是我的excel文件中的行数是不同的,我如何才能得到只有1列的行数。我已经找到了getting rows in file和List of methods in the library,但都没有答案。
发布于 2013-12-31 10:25:45
我遇到了同样的问题。我是通过获取单元格的数组,然后计算行的长度得到的。'int array.Where‘是您想要计算的行。
..
workbook = Workbook.getWorkbook(new File(SheetPath));
..
Sheet sheet = workbook.getSheet(0); //adjust depending on which sheet you need.
//find out how many cells there are on this row.
Cell[] cellColumn = sheet.getRow(row);
int cellCount = cellColumn.length;
System.out.println("cells in col: " + cellCount);下面是额外的接口:http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/
如果你需要更多的澄清,请告诉我
https://stackoverflow.com/questions/19891893
复制相似问题