Why not use the non-printing char as the comma instead of the record separator.
1. Replace all the commas in the text with the unique non-printing char before converting to CSV.
2. Convert this char back to a comma when processing the CSV for output to be read by humans.
Because commas in text are usually followed by a space, the CSV may still even be readable when using the non-printing char.
I must admit I've never understood why others view CSV as so troublesome vis-a-vis other popular formats.
in: sed 's/,/%2c/g'\n out: sed 's/%2c/,/g'
I guess I need someone to give me a really hairy dataset for me to understand the depth of the problem with CSV.
Meanwhile, I love CSV for its simplicity.
that's exactly what https://github.com/dbro/csvquote does for commas and newlines both.