Hi,
My xlsx file has header in second row instead of the top first row. I can't use schema to output rows as object with {columnName:value}.
Is there a way to either:
a) set which row contains header and set reader.startRow and reader.endRow to use schema only against rows in that range
b) set which row contains header and just use titles from that row as keys for other rows without creating a schema.
doesnt skip row 1 (as I'd expect by setting hasHeader: true) and doesn't make {key:value} output. Instead I get an array of values for each row 1 to 4. Behaviour from above point b) should work here.
this._header.forEach((column, index) => {
^
TypeError: Cannot read property 'forEach' of null
at FastXlsxReader._rowFromSchema (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxReader.js:307:18)
at FastXlsxReader._readRow (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxReader.js:290:21)
at FastXlsxReader._handleCallbackEvent (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxReader.js:208:23)
at FastXlsxReader.<anonymous> (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxReader.js:185:14)
at FastXlsxReader.onrecord (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxReader.js:489:36)
at FastXlsxSheetReader.read (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxSheetReader.js:276:35)
at FastXlsxSheetReader.readMany (v:\test\node_modules\fast-xlsx-reader\lib\FastXlsxSheetReader.js:309:34)
at Object.readExcel (v:\test\server\excelRead.js:60:21)
at Object.<anonymous> (v:\test\server\index.js:17:22)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
or
[
'File exported on 08 Jan 21',
'',
'',
'',
''
]
#ERR_SCHEMA: Invalid schema! No mapping for column "File exported on 08 Jan 21". {
ID: 'ID',
'Short Description': 'Short Description',
Type: 'Type',
Assignee: 'Assignee',
Department: 'Department'
}
#ERR: undefined
Hi, My xlsx file has header in second row instead of the top first row. I can't use schema to output rows as object with {columnName:value}.
Is there a way to either: a) set which row contains header and set
reader.startRow
andreader.endRow
to use schema only against rows in that range b) set which row contains header and just use titles from that row as keys for other rows without creating a schema.Trying to use
doesnt skip row 1 (as I'd expect by setting
hasHeader: true
) and doesn't make {key:value} output. Instead I get an array of values for each row 1 to 4. Behaviour from above point b) should work here.Trying to use
I get either
or
Behaviour from point a) should work here.