Quote:
Originally posted by Perderabo
I'm not sure that I understand exactly was is going on here. But I think that you want any single quote surrounded by letters to become two single quotes. If that is correct (and it does seem crazy), try this...
sed "s/\([a-zA-Z]\)\'\([a-zA-Z]\)/\1\'\'\2/g"
|
That's what I was doing wrong with my
sed statement. I was attempting to reference the atoms that I pulled with $1 and $2 like I did in the
Perl code. I needed to use \1 and \2. D'oh.
Replacing the single tic with two single tics isn't crazy at all. After the insert takes place, the two single tics are converted into a single tic. It's the same for MS SQL Server as well.
The
Perl code above can be fixed by replacing double quote with two single quotes back to back, but the
sed expression is much cleaner.