How to split a string by comma, when the elements have some commas


#1

Hi All,
I am working with airports data below put 2 lines from it.
1,“Goroka”,“Goroka”,“Papua New Guinea”,…
2, “Mata’aho Airport”, “Angaha,Niuafo’ou Island”, …

Here we split the records by “,” but in the second record it has a comma in the string , so this get split into 2 values “Angaha” and “Niuafo’ou Island” which we do not want.
how can i split the records and bypass such things which have comma like this.

Any suggestions please help.
Thanks


#2

Try splitting by ‘","’, or search for a regular expression which can split like that.