in reply to Re: Weird Character in File Makes Perl Think it's EOF
in thread Weird Character in File Makes Perl Think it's EOF
tr -d "\032" < infile > outfile
...or...
tr "\032" " " < infile > outfile
If you use Gawk, you have to set its BINMODE.
Using ActivePerl for Windows, I've never had to use binmode to handle nasty ASCII control characters like NUL (0x00) and SUB (0x1A). It seems to read and write them in text mode just fine.
JimD:\>perl -e "print qq{\x00\x1A\nfoo\nbar\x1A\x00\n}" foo bar D:\>perl -e "print qq{\x00\x1A\nfoo\nbar\x1A\x00\n}" | perl -ne "print if m/foo/" foo D:\>
|
---|