Which is better open source for Excel file parsing

2019-04-12 03:48发布

问题:

Which is better API for excel parsing in Java Apache POI or JExcel API? In terms of speed, memory utilization and code stability.

回答1:

Personally I would recommend POI over JExcel. The reasons I chose POI over JExcelAPI are:

  1. POI supports both old and new MS Excel sheet formats
  2. It has a cleaner API (imho)
  3. As far as I can see it does not suffer from the irritating Date\Time issues that JexcelApi has (Date display).

I have had the opportunity to use both. POI, in my opinion, has a really well thought out and easy to use API. The biggest benefit from my perspective is that you can factory off the creation of the worksheet instance and then deal with everything in the context of the usermodel interfaces. This means your code can process both old and new Excel file formats without having to worry about which is which.

Additionally, you are able to read and write the same Worksheet instance. With JExcelApi there is this really strange split between "readable" sheets and "writable" sheets which I found odd. This also resulted in me having to introduce messy work arounds to move from "reading" to "writing" in my code.

I did not notice meaningful performance difference using POI on old, binary files (POI HSSF) and JExcelApi. There is however a significant performance difference between POI HSSF (old format) and POI XSSF (new format). I assume this is because of all the extra work required for unpacking and parseing XML.



回答2:

I recommend using Apache POI, which I used before, especially if you support the Office 2007/8 OpenXML format. JExcel doesn't support that. Apache POI also supports the Office applications.

I cannot comment on the performance part. However, I did have a very large Excel document (millions of columns) but with a relatively small file (few megabites). POI did take few minutes to parse it and modify it. However, in this case, Excel itself took minutes just to load the document.



回答3:

Apache POI is good with the latest formats, but speed wise(parsing) JExcel is better(JExcel doesn't support OpenXML format as notnoop said)



回答4:

JExcelAPi is better than Apache POI except that it does not support Excel 2007 format.