I'm treating csv files using a semicolon as a delimiter and I'm currently using String[] splitLine = line.split(";", -1);
I recently discovered that some genius thought it was a good idea to send data like this :
id;status;comment
123;OK;
134;KO;"bad read; try again"
Apparently, Excel supports delimiters inside quotes like this, so maybe it's allowed in CSV, but that completely messes up my split. How can I change my code so that it's split in the correct number of columns? Either during the split, or cleaning it before, changing the ;
to a ,
for example.
By the way, there can be quotes in the comment field and they shouldn't be removed. For instance :
145;OK;the line "abcd" was malfunctioning