POI读xlsx


@Test
public void testReadByPoi() throws IOException {
//1.获取要读取的文件工作簿对象
Workbook wb = new XSSFWorkbook("test.xlsx");
//2.获取工作表
Sheet s = wb.getSheetAt(0);
//3.获取行
Row row = s.getRow(3);
//4.获取列
Cell cell = row.getCell(1);
//5.根据数据的类型获取数据
// String data = cell.getStringCellValue();
// double data = cell.getNumericCellValue();
boolean data = cell.getBooleanCellValue();

System.out.println(data);

wb.close();
}

posted @ 2020-09-25 22:05  尘缘01  阅读(8)  评论(0编辑  收藏  举报