how read excel file having more than 100000 row in java?

前端 未结 2 1588
日久生厌
日久生厌 2021-01-15 16:44

I am trying read excel file having more than 100000 rows in java using apache poi. but I am encountering few problems.

1-) It is taking 10 to 15 min in fetching dat

2条回答
  •  天命终不由人
    2021-01-15 17:23

    Apache POI is your friend - this is correct. But I faced with OutOfMemory when I read very big Excel with formulas.

    My solution. If you want to only read data from XLSX file, and do not worry about formulas, then do read it as simple xml file and extract data from it (it us pretty easy).

    1. Read your *.xlsx file as zip archive
    2. Got to xl\worksheets folder and you find one xml file per one sheet
    3. Read this file using any xml reader and retrieve data you need

提交回复
热议问题