I'm looking to split a string that is comma separated. The array1 is populated from a string of rows got in a .csv file.
Array2 then splits this into seperate values. It works fine, but not if I have a comma inside quotes.
for (var i = 0; i < array1.length; i++) {
array2.push(array1[i].split(","));
}
i.e.
array1[0] = abcde, defg, hijkl;
array1[1] = abcde, "def,ghi" , jklmn;
should become
array2[0]....
array2[1][0] = abcde
array2[1][1] = def,ghi
array2[1][2] = jklmn
How can I prevent a split at the quoted comma?