File test = new File("D:\\test.xlsx");
try {
XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(test));
SXSSFWorkbook workbook = new SXSSFWorkbook(wb);
Sheet sheet = workbook.getSheetAt(0);
for (int i = 0; i < 5; i++) {
Row row = sheet.getRow(i);
if(row==null){
System.out.println(i+":null");
}
}
} catch (Exception e) {
e.printStackTrace();
}
2021-12-27 15:42:30
14KB
java
1