How to get value from a specific cell of an xlsx file using java apache poi

前端 未结 5 1410
一生所求
一生所求 2020-12-30 08:54

I am writing a java program to read an excel sheet (xlsx) using apache poi. I am able to iterate through all the cells and get all the values. But I am unable to get a spec

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 09:34

    XSSFSheet has the method getRow(int rownum) It returns the logical row ( 0-based). If you ask for a row that is not defined you get a null. This is to say row 4 represents the fifth row on a sheet.

    Once you get the row, you can call getCell(int cellnum) method of XSSFRow object. It returns the cell at the given (0 based) index.

提交回复
热议问题