Which of the 2 APIs is simpler to read/write/edit excel sheets ? Do these APIs not support CSV extensions ?
Using JXL for file.xls and file.xlsx, I get an exception like:
jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
at jxl.read.biff.File.<init>(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:268)
at core.ReadXLSheet.contentReading(ReadXLSheet.java:46)
at core.ReadXLSheet.init(ReadXLSheet.java:22)
at core.ReadXLSheet.main(ReadXLSheet.java:72)
Both for .xls and .xlsx extensions. Java Version I am using is : JDK1.6
This question is related to
java
excel
apache-poi
jxl
For reading "plain" CSV files in Java, there is a library called OpenCSV, available here: http://opencsv.sourceforge.net/
I am not familiar with JXL and but we use POI. POI is well maintained and can handle both the binary .xls format and the new xml based format that was introduced in Office 2007.
CSV files are not excel files, they are text based files, so these libraries don't read them. You will need to parse out a CSV file yourself. I am not aware of any CSV file libraries, but I haven't looked either.
I have used POI.
If you use that, keep on eye those cell formatters: create one and use it several times instead of creating each time for cell, it isa huge memory consumption difference or large data.
Source: Stackoverflow.com