Open onigetoc opened 1 year ago
By default we treat the object's keys and array's indices as col title, you can omit the indices by using beforeTableEncode
.
Add such option to EFJ:
beforeTableEncode: rows => rows.map(row => ({ fieldName: '', fieldValues: row.fieldValues }))
I'm using JSpreadsheet CE and i want to export the json to XLSX, XLS, CSV. https://github.com/jspreadsheet/ce
The problem is JSpreadsheet CE give me this object:
But when i convert it with export-from-json to CSV it will give me:
It's working but exportFromJSON will always add on the first CSV line: 0,1,2,3,4,5,6,7,8,9....
I think it's because in the array of the header (first line) the names are not in the
getData()
loop and export-From-JSON will think there's no header or is not compatible. But it's a valid way to do it and JSpreadSheet (or any CSV files readers) will know that the first line is the header. but not the new saved file with exportFromJSON. Because it will add these numbers on the first line: 0,1,2,3,4,5,6,7,8,9 and it will become the new header.How can i tell exportFromJSON to not do that? It look like that if exportFromJSON do not find the headers keywords in the datas from the header array
(fields)
it will add these numbers or it will just not work.It will also add these numbers in the XLSX file ect. But if it would add the header fields instead it would probably work perfectly to export my CSV or Excel files made with JSpreadSheet-CE.