Skip to content

Doubt regarding workSheetReader.abort and workSheetReader.skip function. #57

@gaurav-cointab

Description

@gaurav-cointab

Is my understanding correct regarding the workSheetReader.abort() and workSheetReader.skip() function.

The code will stop the processing of the worksheet as soon as workSheetReader.abort() is called, and then it will go on to other sheet, and if all other sheets are skipped by calling workSheetReader.skip() function, then the processing of the excel file will stop there it self, and workBookReader.on('end') event will be triggered.

If the above understanding is correct, then workSheetReader.abort() or workSheetReader.skip() is not working as expected.

I have a very large file (300MB) and I am reading only the first sheet like this.

if (workSheetReader.id > 1) {
    workSheetReader.skip();
    return;
}

And I am trying to only read the header row by this code

workSheetReader.on('row', function (row) {
    if (row.attributes.r == 1) {
        // do something with row 1 like save as column names
    } else{
        workSheetReader.abort();
    }
});

The code is stopping after a good 10-15 min. So I am assuming that the code is processing all the other rows, and sheets as well, before stopping the processing.

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