【发布时间】:2019-07-13 09:17:51
【问题描述】:
我想从 excel 中找到总行数。内存不足异常
try {
InputStream myxls = new FileInputStream("File path");
workbook = new XSSFWorkbook(myxls);
System.out.println(ele.productHierarchyText());
XSSFSheet sheet = workbook.getSheet("Sheet Name");
XSSFRow row = sheet.getRow(0);
int colNum = row.getLastCellNum();
System.out.println("Total Number of Columns in the excel is : " + colNum);
rowNum = sheet.getLastRowNum() + 1;
System.out.println("Total Number of Rows in the excel is : " + rowNum);
}
【问题讨论】:
-
为您用来解析的库添加链接和/或标签。