$/ = CR LF? 
Author Message
 $/ = CR LF?

This is driving me nuts - I've got hundreds of input files
with record separator <CR><LF> but I can't persuade
<INFILE> to break on the record separator. I've tried:

    $/ = "\r\n"
    $/="\015\012"
    $/="^M
    "

where the last is a manual cut and paste of the EOR string.
When I use the default (\n) the files are read in fine - except
for those few records that have imbedded \n's. What am I
missing here?

thanks,

jeph
--
Jeph Herrin



Sun, 29 Aug 2004 23:17:32 GMT  
 $/ = CR LF?

Quote:

> This is driving me nuts - I've got hundreds of input files
> with record separator <CR><LF> but I can't persuade
> <INFILE> to break on the record separator. I've tried:

>     $/ = "\r\n"
>     $/="\015\012"
>     $/="^M
>     "

> where the last is a manual cut and paste of the EOR string.
> When I use the default (\n) the files are read in fine - except
> for those few records that have imbedded \n's. What am I
> missing here?

If you're on a Windows platform, you might have better luck
by putting the file in binary mode -- "perldoc -f binmode".

-- Dave Tweed



Sun, 29 Aug 2004 23:21:04 GMT  
 $/ = CR LF?

Quote:

> If you're on a Windows platform, you might have better luck
> by putting the file in binary mode -- "perldoc -f binmode".

> -- Dave Tweed

Aha. I recently migrated from Linux, so hadn't seen this "feature"
of windoze before.

Thanks,
jeph



Mon, 30 Aug 2004 00:05:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Converting LF to CR+LF

2. DOS Perl convering LF to CR/LF

3. <FILE> and CR-LF

4. Binary data and CR-LF's in MSDOS

5. CR/LF

6. how to remove cr/lf ???

7. Question about formatting/(CR/LF) in PERL

8. Perl and CR+LF

9. CR LF to <br> in REGEX

10. CR/LF from a form

11. unwanted CR/LF translation in FILE UPLOAD

12. split function on CR/LF

 

 
Powered by phpBB® Forum Software