I have a .csv that I need to convert to a coldfusion query. I have used the cflib.org CSVtoQuery method which works fine… but…
If there is a ‘cell’ in the csv that includes a comma in the string, such as a list, the query row for that record gets messed up as it sees the comma in the string as a new value.
I have no control over how the data is going in, so I can’t have it written or passed inside quotes or the like.
Does anyone know if there is a way to process a .csv (convert to a query or other workable struct) that may have commas in the values?
No, there isn’t. Whoever is making the CSV is not making it properly. No CSV parser can tell the difference between commas that separate and commas that don’t if there is no way to tell the difference.
Whoever is making the file should choose a different delimiter.