* [EMAIL PROTECTED] wrote:
> Hi all,
> Is there a way to remove all control characters from a file?
> eg: I have a file that has characters: ^M, ^@, ^L, etc which need to be 
> removed, but the file also contains: ? and alike that need to stay.
> How could I accomplish this?

If you know the idividual control chars you want to remove (eg ctrl m), you
can do something like this in vi:

ESC
:%s/{ctrl v}{ctrl m}//gc

or

:%s/{ctrl v}{ctrl m}//g for no confirmation messages

(Stuff in {} you actually type).

--
Savanna                 |  Free as in 'free speech',
GnuPG Pub Key E40FAE08  |  not 'free beer'.
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to