初学实战篇
读取Excel内容
- 取Excel中的数值
NPOIFSFileSystem fs = new NPOIFSFileSystem(new File("wb8.xls"));
Workbook wb = new HSSFWorkbook(fs.getRoot(), true);
for (Sheet sheet : wb) {
for (Row row : sheet) {
for (Cell cell : row) {
//取数值
double value = cell.getNumericCellValue();
System.out.println(value);
}
}
}
fs.close();