I am trying to split data from a .csv file, however, some of the fields/columns also contain commas in between just like this
ABCKS,"ASK,ED","SDR,ED",2022-07-11,8011.0
cvbgb,"hfhvnf,rgr","dthd,chdf",2022-07-11,111.9
ABCKS,"ASK,ED","SDR,ED",2022-07-11,8011.0
hence, the .split(",") string method would create additional fields into the data.
I have tried
if (aLine.contains("\"|,|\"")){
String newString = aLine.replaceAll("\"|,|\"","|_|").replaceAll("\"", "");
aList = Arrays.asList(newString.split(",", -1));
}
It does not seem to work.