tafia / calamine

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
MIT License
1.6k stars 155 forks source link

support DataTypeRef for shared strings and worksheet CellsReader #370

Closed tafia closed 6 months ago

tafia commented 8 months ago

Here is another iteration at trying to reduce memory usage.

Introduce a new DataTypeRef which is the same as DataType but with an additional SharedString variant.

The test case from #362 should be amended with:

    // Get worksheet
    let sheet = excel
        .worksheet_range_ref("NYC_311_SR_2010-2020-sample-1M")
        .unwrap()
        .unwrap();

NOTE: Given that large test file, we may revisit a protection used against files with mostly blank cells: https://github.com/tafia/calamine/pull/370/files#diff-bedb7172be56842bcb4be66655e6eb625dadc8a029fe3c87c6657768ef1fc8b9R662

tafia commented 8 months ago

It remains to be seen if this can be ported to other file formats.

tafia commented 8 months ago

cells reader and DataTypeRef have been ported to xlsb. Ods and Xls may not be possible as we need to read the whole file at once.