Apache POI XSSF reading in excel files

前端 未结 8 1723
粉色の甜心
粉色の甜心 2021-02-13 00:12

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:32

    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);
    

提交回复
热议问题