Convert an excel xlsx file with nested headers into json

Viewed 696

I am converting my excel file to json using the below library and it works fine when I have one header row and the remaining rows are data.

var excelToJson = require('convert-excel-to-json');

var result = excelToJson({
sourceFile: 'Auto.xlsx',
header: {
    rows: 2 //Used 2 to skip the first line of headers
},
columnToKey: {
   '*': '{{columnHeader}}'
}
}); 

But I have a file that has nested rows as headers similar to below and want to convert that into json.

enter image description here

Something like this, with multiple sheets enter image description here

Appreciate any help or pointers. Thanks!

0 Answers
Related