Open sjorsjes opened 1 year ago
const csv = 'type,part,part\nunicorn,horn,eye\nrainbow,pink,tail'; console.log(await neatCsv(csv)); // [{type: 'unicorn', part: 'horn', part_1: 'eye'}, {type: 'rainbow', part: 'pink', part: 'tail'}]
When importing a CSV file with non unique header names into Excel it will add _#. In this example it will create the following headers: type | part | part_1
_#
type | part | part_1
const csv = 'type,part,part\nunicorn,horn,eye\nrainbow,pink,tail'; console.log(await neatCsv(csv)); // [{type: 'unicorn', part: 'eye'}, {type: 'rainbow', part: 'tail'}]
It looks like it overrides the previous column with the same header name.
Use the examples from above or see this sandbox https://codesandbox.io/s/read-file-node-ejs-forked-pqmqrm?file=/src/index.js
Expected Behavior
When importing a CSV file with non unique header names into Excel it will add
_#
. In this example it will create the following headers:type | part | part_1
Actual Behavior
It looks like it overrides the previous column with the same header name.
How Do We Reproduce?
Use the examples from above or see this sandbox https://codesandbox.io/s/read-file-node-ejs-forked-pqmqrm?file=/src/index.js