On Friday, August 30, 2002, at 12:51 , Omanakuttan wrote:

> I am trying to strip off ^Ms from a number of text files.
> The following does not seem to work. any suggestions?
[..]
> Thank you.

my favorite generic solution is:

http://www.wetware.com/drieux/pbl/RegEx/eolOut.txt


        my $cr = chr(13);       # the ascii value for <CR> - the '\n'
        my $lf = chr(10);       # the ascii value for <LF> - the '\r'
        my $eol = "$cr|$lf";


        while(<FH>) {
        my $thing=$_;
                 $_ =~ s/[$eol]+//g ;
                 print ":$_:\n";
                 print "SCREAM: still have a \\r in \$_\n" if ( /\r/ )  ;
        print "\t As expected \$thing has a \\r \n" if ( $thing =~ 
m/\r/ ) ;
        }
        close(FH);

ciao
drieux

---


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

Reply via email to