I have a flat file where I have multiple occurrences of strings that contains single quote, e.g. hari's
and leader's
.
I want to replace all occurrences of the single quote with space, i.e.
- all occurences of
hari's
tohari s
- all occurences of
leader's
toleader s
I tried
sed -e 's/"'"/ /g' myfile.txt
and
sed -e 's/"'"/" "/g' myfile.txt
but they are not giving me the expected result.
Advertisement
Answer
Try to keep sed commands simple as much as possible. Otherwise you’ll get confused of what you’d written reading it later.
#!/bin/bash sed "s/'/ /g" myfile.txt