The ^M is equivalent to the '\r'.
When a binary ftp session is used to bring a file from a Windows environment to a Unix environment the '\r\n' is carried over as well.
Try 's/\r//g'
>From: "Martin Moss" <[EMAIL PROTECTED]>
>To: "AITHA, BHEEMSEN \(SBCSI\)" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>Subject: Re: [Perl-unix-users] ^M characters
>Date: Fri, 7 Jun 2002 21:24:44 +0100
>
>recopy your file in ascii mode,
>This will remove the ^M.
>
>other wise the character you are looking for is a single character not '^' +
>'M'
>you can tell this in vi by scrolling your cursor across it, you'll note the
>cursor moves two spaces.
>
>Can't remember what the unix keyboard command is to produce that char. My
>advice is copy and paste one from the document into your Reg ex
>
>Regards
>
>Marty
>----- Original Message -----
>From: "AITHA, BHEEMSEN (SBCSI)" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, June 07, 2002 7:10 PM
>Subject: [Perl-unix-users] ^M characters
>
>
> > Hi,
> >
> > I had copied some files from c:\ drive on to Unix machine. At the end of
> > each line, I see the end of line character(^M). To get rid of all these ^M
> > characters, I had opened a file in vi and performed the following command.
> >
> > :s/^M//g
> >
> > But vi says that pattern does not exist. Is there any other hidden
>character
> > associated here ? Can any one tell me how to get rid of them. I have lots
>of
> > files. A small perl script would be a lot of help to me.
> >
> > Thanx..
> > -Bheem
> >
> > _______________________________________________
> > Perl-Unix-Users mailing list
> > [EMAIL PROTECTED]
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> >
>
>_______________________________________________
>Perl-Unix-Users mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
.
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs