Two potential answers. None of them are perfect. If you have commas in some results but no pipes ( | ), you can switch to channelization with
set colsep '|'
Most programs that can read csv will do just fine with this format.
If this does not work for you, you can understand that to process commas inside a column, you need to wrap each data item in quotation marks:
"data 1","data 2","data,with,commas"
To do this, each delimiter must be "," so you can
set colsep '","'
This will not have quotation marks at the beginning and end of each line, so you can wrap each line in quotation marks with sed :
sed 's/^[^$]*$/"&"/'
source share