perl.beginners
[Top] [All Lists]

Re: how to remove ^M character from every line

Subject: Re: how to remove ^M character from every line
From: Gunnar Hjalmarsson
Date: Mon, 03 Sep 2007 21:42:07 +0200
Newsgroups: perl.beginners


divya wrote:
A file generated on Windows machine is used on linux m/c while scripting.
A sample line from the file is as shown:

//-------------------------------------------------------^M
File name : project_name^M
.....

Now in the perl script how can I remove ^M without running the command dos2unix.

    perl -pi -e 'y/\015//d' project_name

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

<Prev in Thread] Current Thread [Next in Thread>