Skip to content

[Xlsx-Import] How to handle multiple rows of headers? #165

Locked Answered by Siemienik
fnick851 asked this question in Q&A
Discussion options

You must be logged in to vote

@fnick851 Thank you for asking me 👍 I will attempt to answer you as perfect as I can.

Hi, how to read sheet with multiple rows of header? Is it possible at all?

Yes it is by using rowOffset: 2

for instance:

    {
            type: 'list',
            worksheet: 'Person',
            columns: [
                {
                    index: 1, // column A
                    key: 'isMale',
                    mapper: (v: string) => v.toLowerCase() === 'x'
                },
                {
                    index: 2, // column B
                    key: 'isFemale',
                    mapper: (v: string) => v.toLowerCase() === 'x'
                },
                {index: 3, key: 'Name'}

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Siemienik
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #15 on March 31, 2021 12:55.