I would do it in a Java class. Then use Coldfusion to create
an object from that, for any given string. Equip the object with
the following functionality.
Function 1: For any given string s, create the corresponding
String object,
new String(s). Use a loop and the function indexOf("\"",
fromIndex) to iteratively pick out the indices of all the quotes.
If a quote occurs at index N, the next iteration starts with the
value fromIndex=N+1. Store the quotes' indices in pairs (opening
and closing quotes), for example, in a 2D array.
Function 2: Given the original string object and an array of
(beginIndex, endIndex) integer pairs, use the function charAt(n) to
find where a comma occurs in the quoted parts of the string, and
replace each such occurrence with , . Here n is a dummy
integer variable that ranges from beginIndex-1 to endIndex-1 for
each pair of indices.
The following snippet is an attempt I made with Coldfusion.
However, it mistakenly fails to see indexOf as a function of the
String object. And I, alas, am too busy with other things to pursue
this line of interrogation with Coldfusion at the moment. I hope
the snippet conveys enough of the flavour of Function 1 to inspire
you to a solution.