[Java] 使用Java自动获取Excel的rows 和 columns
File file = new File(filePath); XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(filePath)); XSSFSheet sheet = wb.getSheet(sheetName); int rows = sheet.getPhysicalNumberOfRows() Row row1 = sheet.getRow(1) log.info row1.getPhysicalNumberOfCells()