To attempt to correct for this, I set the $/ variable to "\x0D\x0A". While processing the files, I then did a quick s/\x0A/ /g to "fix" the data. When tested in Linux, this worked perfectly. Unfortunately, this program must run in Windows.
That will work in Windows if (and only if) you binmode IN first. For example:
local $/ = "\x0D\x0A"; open(local *IN, '<', $filename) or die("Unable to open input file $filename: $!\n"); binmode(IN); while (<IN>) { chomp; s/\x0A/ /g; ... }
Without binmode, occurances of "\x0D\x0A" are converted to "\x0A" before Perl looks for the line ending.
In reply to Re: Windows file read
by ikegami
in thread Windows file read
by thedoe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |