I have the following string of a CSV file
var arreglo = ['"Marcopolo b1 "', '"Marcopolo b1, Leito "','"Marcopolo b2, "']
var headers = allTextLines[0].split(/\t|,/);
// this function returns:
var allTextLines = ['"Marcopolo b1 "', '"Marcopolo b1, Leito "','"Marcopolo b2, "']
for (var i = 1; i < allTextLines.length; i++) {
var cut = allTextLines[i].split(/\t|,/);
console.log(cut);
}
but what I hope is output:
{ "Marcopolo b1 "
}, { "Marcopolo b1, Leito "
}, { "Marcopolo b2, "
}
How would the pattern be to result in this? Thanks
Sorry for not having explained well, what happens is that I have a * .csv file to validate, which has the following values: name, description, mail "TRANS COPACABANA", "description of the mission, description1, description 2", "[email protected]" If you look at the description column I have double quotes and two commas, and I need to recover that entire description, removing only double quotes and not being considered as another column by the commas that it presents, more or less like this: description of the mission, description1, description 2