sql - REGEXP to insert special characters, not remove -
how put double quotes around 2 fields missing it? able use instr/substr/replace in 1 statement accomplish it?
string := '"es26653","abcbeverages","861526999728",606.32,"2017-01-26","2017-01-27","","",77910467,"dorothy","","rapp","14219 pierce street, apt1","","omaha","ne","68144"'; expected string := '"es26653","abcbeverages","861526999728","**606.32**","2017-01-26","2017-01-27","","","**77910467**","dorothy","","rapp","14219 pierce street, apt1","","omaha","ne","68144"';
please suggest! thank you.
this answer not work in case, because fields contain commas. leaving in case helps else.
one rather brute force method internal fields is:
replace(replace(string, ',', '","'), '""', '"')
this adds double quotes on either side of comma , removes double double quotes. don't need worry ""
. becomes """"
, ""
.
this can adapted first , last fields well, complicates expression.
Comments
Post a Comment