develooper Front page | perl.beginners | Postings from July 2006

How to split a file on the CR carriage Return and/or replacethe \r with \n ??

Thread Next
From:
Steve Pittman
Date:
July 26, 2006 12:59
Subject:
How to split a file on the CR carriage Return and/or replacethe \r with \n ??
Message ID:
44C7915F020000C2000016C8@cis27.hosts.jhmi.edu
I am using activestate on a windows box ...the files I am parsing are
Unix files...I tried this so far...

open ( IN, "<$_[0]" )||die "Can't open DAT source file: $tempFile
$!\n";
	while (<IN>){s/\r/\n/g;@lines = <IN>;}#
	close (IN);
	
	foreach $line (@lines)
	{

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About