[ale] perl help

Matthew Brown matthew.brown at cordata.net
Fri Apr 12 10:35:22 EDT 2002


Thanks...  That helped!

Best regards,
Matthew Brown, President
CorData, Inc.
O: (770) 795-0089
F: (404) 806-4855
E: matthew.brown at cordata.net


-----Original Message-----
From: Ken Nagorski [mailto:kenn at pcintelligent.com] 
To: ale at ale.org
Sent: Friday, April 12, 2002 10:12 AM
To: ale at ale.org
Subject: Re: [ale] perl help


Try this,


open(FILE, "lalala");
while(<FILE>)
{
        $_ =~ s/\r\n/\n/;
        print($_);
}

Replace of course, with your filename...

Also - in vi,

:%s/^M//g

NOTE!!! The ^M you see is put there by holding down Ctrl+v (this says,
"hey vi - the key a control char") Then, still holding down the Ctrl key
hit m, this will place the ^M in there and then you are set, type the
rest out and hit enter... and remeber, real geeks do it with vi!

Thanks
Ken



> I need to switch out the \r\n 's with \n 's on a bunch of files from 
> Windows so I can easily use them in Linux.  SO, now I have two
> questions:
> 1.    What happened to that dos2unix util?
> 2.    How can I easily do this in Perl?
>
> Thanks, all!
>
>
> Best regards,
> Matthew Brown, President
> CorData, Inc.
> O: (770) 795-0089
> F: (404) 806-4855
> E: matthew.brown at cordata.net
>




---
This message has been sent through the ALE general discussion list. See
http://www.ale.org/mailing-lists.shtml for more info. Problems should be

sent to listmaster at ale dot org.


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list