Afficher un message
Vieux 27/05/2007, 21h06   #4
John W. Krahn
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: removing rogue characters with sed

waffle.horn@googlemail.com wrote:
>
> 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/`/ /'
>
> It doesn't seem to work for all instances. Any idea would be much
> appreciated


If you want to remove them:

tr -d '@`' < FILENAME

If you want to replace them with a space like your example shows:

tr '@`' ' ' < FILENAME



John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
  Réponse avec citation
 
Page generated in 0,05146 seconds with 9 queries