[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()

 

posted @ 2017-05-11 17:04  Sunshine168  阅读(690)  评论(0编辑  收藏  举报