node-csvtojson
node-csvtojson copied to clipboard
CSV field to JSON array
Does anybody know how I can convert the gallery field in the CSV into a JSON array? The field is a list of image URLs separated by pipes.
I have the following CSV.
At the moment the result I get from csvtojson is:
I am trying to create the following. If somebody can point me to the right direction.
solved it for now with:
const converter = csv({
colParser: {"gallery":function(item, head, resultRow, row, colIdx) {return item.split("|")}},
});