所需依赖库
实例
Workbook excel = new HSSFWorkbook(new FileInputStream(new File("C:\\123.xls")));
excel.sheetIterator().forEachRemaining(sheet -> {
sheet.rowIterator().forEachRemaining(row -> {
row.getRowNum();
row.getCell(0).getStringCellValue(); //读单元格
row.getCell(1).setCellValue("hello world!"); //写单元格
});
});
excel.write(new FileOutputStream(new File("C:\\456.xls"))); //另存到文件
excel.close();

1244

被折叠的 条评论
为什么被折叠?



