On Mon, 16 Jul 2001, System Administrator wrote:

> This is for newbies, right? Can anyone tell me why a s/^M//g won't get
> rid of the annoying ^M on the end of each line of an imported Paradox
> database? Is there a better way? I know this has to be simple, yet I
> can find no reference in my plethora of Perl books. TIA for any and
> all help - you guys are great and I appreciate the time you all put
> into this effort to help folks like me :-)

perl -pi.bak -e 's/\cM//g' <file>

will do the trick, right n the command-line.  Using s/^M//g won;t work
because ^ in a regexp tries to match the beginning of the string, so your
regexp is trying to match a string that starts with M and replace it with
an empty string.  Not what you wanted!  \cM matches against the Control-M
character.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
You have a deep appreciation of the arts and music.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to