I've got an XLSX sheet that contains about 30 columns and 130,000 rows.
In the past I used OleDb data reader to parse such files but it was problematic in case of reading unknown excel files with mixed cell data types.
I found ClosedXML but the issue I have with it is that the memory usage is much higher than in the case of OleDb. I might be missing something but it appears that the entire workbook has to be loaded before even a single cell can be accessed, my memory usage goes up by ~500MB when I want to read a single cell:
using (XLWorkbook workBook = new XLWorkbook(_path))
{
IXLWorksheet workSheet = workBook.Worksheet(tableName);
Console.WriteLine(workSheet.Cell(1, 1).Value);
}
Is there any way to optimise this?
- Lazy loading cells?
- Reducing the amount of loaded cell properties just to the ones that are of interest?
- Anything?
If there's no options to optimize this would you be able to recommend any other frameworks/libraries?
Thanks.