On 2007-05-27,
waffle.horn@googlemail.com <waffle.horn@googlemail.com> wrote:
> Hi all,
>
> Im trying to remove two types of rogue characters but I can't seem to
> think of the correct solution with sed. The characters Im trying to
> remove are the @ and ` characters shown below
>
> -0.1000@-0.1000
>
> -0.1000`-0.1000
>
> I have tried...
>
> sed 's/@/ /' FILENAME | sed 's/`/ /'
You probably weant the 'g' option to s to make the replacements
global. Without it sed will only replace the first occurance.
You also don't need to call sed twice like this. You can feed sed
more than one command at a time, or in this instance combine the
commands into one:
sed 's/[@`]/ /g' FILENAME
That will replace either a "@" or "`" with spaces like your example
above did. To actually delete them, replace the command to sed
with 's/[@`]//g'
--
Andrew Smallshaw
andrews@sdf.lonestar.org