编程语言
首页 > 编程语言> > java XSSFWorkbook 数据读取

java XSSFWorkbook 数据读取

作者:互联网

 

     XSSFWorkbook book = new XSSFWorkbook(file.getInputStream());
        XSSFSheet sheet = book.getSheetAt(0);
        for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
            XSSFRow row = sheet.getRow(i);
            row.getCell(0).setCellType(CellType.STRING);
            row.getCell(1).setCellType(CellType.STRING);
            row.getCell(2).setCellType(CellType.STRING);
            String v1 = row.getCell(0).getStringCellValue();
            String v2 = row.getCell(1).getStringCellValue(); 
            String v3 = row.getCell(2).getStringCellValue();
        }

 

标签:java,读取,String,getStringCellValue,getCell,STRING,XSSFWorkbook,row
来源: https://www.cnblogs.com/wifeyj/p/15827501.html