Closed tlhe closed 6 years ago
Can you clarify what you want to do?
That's not really a CSV. Or would you like to have a 1 column CSV with that data? Doesn't make much sense...
you could just do something like [1,2,3,4,'1,2,3,4'].reduce((csv, elem) => csv + '\n' + elem, '')
an array like ['a','b','c','d,e'] i want use json2csv to get an csv file
What would you expect from ['a','b','c','d,e']?
What should be the header? And what should be in each row?
no header and each row is ['a','b','c','d,e'] and i want to get a,b,c,'d,e' in csv
json2csv is intended to convert an array of objects not an array of strings (or dates, or numbers, or anything else ,for that matter)
Honestly, I don't see much value on what you propose. Sounds like something that you could achieve with basic JS as I said above [1,2,3,4,'1,2,3,4'].reduce((csv, elem) => csv + '\n' + elem, '')
I'll close this since I don't think that it will be implemented in the library. Feel free to argue otherwise.
eg:[1,2,3,4,'1,2,3,4']