Skip to content

Queston - Reading multiple parts of excel sheet performance #326

@dotnetshadow

Description

@dotnetshadow

Hi there,

Thanks for the library, my question is about reading multiple parts of an excel sheet

Let's say the excel sheet is made of the following parts

Id Price
1 Product1
2 Product2

Then lets say you have blank line and another set of rows

Id Car Color
1 Ferrari Red
2 Ford Blue
3 MG Green

Using the code below, is the file loaded once and items are extracted from different row positions? Or is the file read each time?
If it's the latter, is there anyway to load the file once and then just extract from that?

var products = new ExcelMapper(@"../../../xlsx/Sheet1.xlsx")
        {
            HeaderRowNumber = 2,
            MinRowNumber = 3,
            MaxRowNumber = 4,
        }.Fetch<Product>().ToList();

var products = new ExcelMapper(@"../../../xlsx/Sheet1.xlsx")
        {
            HeaderRowNumber = 6,
            MinRowNumber = 7,
            MaxRowNumber = 10,
        }.Fetch<Product>().ToList();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions