[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: regexp help



Vineet Kumar, 2002-Jul-25 13:31 -0700:
> * Jeff (jcoppock1@attbi.com) [020725 13:14]:
> > I know there are regexp guru's here, so I figured I'd ask for help
> > with at search & replace I need to do.  A number of text files I have
> > are loaded with ^M and ^@ characters that I can't find the right
> > regexp to find them in order to get rid of them.  I tried a bunch of
> > things both direct and using special characters, but I can't get it
> > right. 
> 
> This depends on what tools you're using. That also affect how the bytes
> that are actually in the file in question are being displayed to you.
> 
> In vim, you can precede a control character with ctrl+v to enter it
> literally into the editing buffer. For example, to get a ^M (carriage
> return) you can hit ctrl+v ctrl+m, and vim will insert the CR character
> (displayed as ^M on your screen). Similarly, the ^@ is probably a null
> character, which can be entered in vim as ctrl+v 000 . Thus you see that
> ctrl+v can also be used to enter any character by its decimal, octal, or
> hex representation. For detailed help on how to use this feature, type
> ":help i_CTRL-V_digit". 

Thanks a lot Vineet!  I use both vim and emacs, so your explanation
was what I needed.  I got my files cleaned up nicely now.

Simon's explanation of sed will be very helpful too.  I haven't gotten
around to learning to use sed yet, but I plan to use this info to
build a little script using sed to clean up these files even faster.

thanks,
jc



--
Jeff Coppock		Systems Engineer
Diggin' Debian		Admin and User


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: