我可以使用 apache poi.. 读取 excel 表列吗?(不使用行迭代器)
for (Row row : sheet) {
Cell firstCell = row.getCell(0);
// Printing Stuff
}
我知道,上面的会做同样的事情。但我需要在不使用行迭代器的情况下获取第一列的数据。
我可以使用 apache poi.. 读取 excel 表列吗?(不使用行迭代器)
for (Row row : sheet) {
Cell firstCell = row.getCell(0);
// Printing Stuff
}
我知道,上面的会做同样的事情。但我需要在不使用行迭代器的情况下获取第一列的数据。
您可以在不使用迭代器的情况下迭代工作表
Workbook wb = WorkbookFactory.create(new FileInputStream("file.xls"));
Sheet sheet = wb.getSheetAt(0);
for (int j=0; j< sheet.getLastRowNum() + 1; j++) {
Row row = sheet.getRow(j);
Cell cell = row.getCell(0); //get first cell
// Printing Stuff
}