I have a txt
file and it has lines like below:
"abc","bkc", "New York", "NY","cool guy"
I am looking to replace comma with semicolon(;) that don't have a comma inside double quotes:
Desired Output:
"abc";"bkc"; "New York"; "NY";"cool guy"
Is there a way to do this in Java?
String replacorPattern = "[^(\\\\)]\\\" *, *\\\"";
String result = fileContent.replaceAll(replacorPattern, "\";\"");
System.out.println(result);
– Jul 17 '20 at 04:47