You can use the following sed script, I believe:
:again s/'\(.*\)--\(.*\)'/'\1\2'/g t again
Save this in a file (rmdashdash.sed) and execute any exec magic in the scripting language to make the following shell equivalent:
sed -f rmdotdot.sed <file containing your input
What the script does:
:again <- just a label
s/'\(.*\)--\(.*\)'/'\1\2'/g
replace, for a pattern 'followed by something followed by - followed by something followed by', only two anythings inside quotes.
t again <- return the received string back to sed again.
Note that this script converts '----' to '', since this is a sequence of two - inside quotation marks. However, '---' will be converted to '-'.
There is no school like the old school.
source share