I want to parse old .xls Excel file, with only one sheet inside. There are no formulas and if it is no much different than it would be if I were using .csv. I just want the values that are there. How can I access the value inside of a certain cell?
First I tried using POI, I wrote my code to discover the error message:
org.apache.poi.hssf.OldExcelFormatException: The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)
I have read the question How to process old excel .xls files using POI? and I couldn't understand (after reading the documentation) how I read the value on a certain cell.
This was the best I could do:
private static String extractExcel(File fileEntry) {
OldExcelExtractor wb = new OldExcelExtractor(fileEntry);
return wb.getText();
}
I had two problems here:
- It returns a string, a cell by line.
- It converts integers to float.