企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
```java @Test public void read01() throws IOException { //加载本地的excel文档 XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream("e:/excel/poi/read/001.xlsx")); //获取表格 XSSFSheet sheet = workbook.getSheetAt(0); //获取总行数 int rows = sheet.getPhysicalNumberOfRows(); for (int i = 0; i < rows; i++) { //获取行 XSSFRow row = sheet.getRow(i); //获取每一行的总列数 int cols = row.getPhysicalNumberOfCells(); for (int k = 0; k < cols; k++) { //获取列 XSSFCell cell = row.getCell(k); //获取值 String value = cell.toString(); System.out.println(value); } } } ```