Apache POI XSSF reading in excel files

前端 未结 8 2093
北恋
北恋 2021-02-13 00:00

I just have a quick question about how to read in an xlsx file using the XSSF format from Apache.

Right now my code looks like this:

InputStream fs = ne         


        
8条回答
  •  囚心锁ツ
    2021-02-13 00:35

    I bealive that this will answer your questions: http://poi.apache.org/spreadsheet/quick-guide.html#ReadWriteWorkbook

    In short, your code should look like this:

    InputStream inp = new FileInputStream("workbook.xlsx");
    Workbook wb = WorkbookFactory.create(inp);
    Sheet sheet = wb.getSheetAt(0);
    Row row = sheet.getRow(2);
    Cell cell = row.getCell(3);
    

提交回复
热议问题