Re: removing rogue characters with sed
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Sun, 27 May 2007 14:14:47 -0400
On 2007-05-27, waffle.horn@xxxxxxxxxxxxxx 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@xxxxxxx
-0.1000`-0.1000
I have tried...
sed 's/@/ /' FILENAME | sed 's/`/ /'
It doesn't seem to work for all instances.
Presumably, those instances are where there's more than one such
character on a line. For that you need to use global substitution
(and you can do it with a single call to sed):
sed -e 's/@/ /g' -e 's/`/ /g' FILENAME
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- References:
- removing rogue characters with sed
- From: waffle . horn
- removing rogue characters with sed
- Prev by Date: Re: web requests?
- Next by Date: Re: removing rogue characters with sed
- Previous by thread: removing rogue characters with sed
- Next by thread: Re: removing rogue characters with sed
- Index(es):
Relevant Pages
|