Re: Script OK on RO... but fails on PC nsPerl
[email protected] (Philip Perry) Fri, 5 Jul 2002 22:06:26 +0000 (GMT)
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
Hello All,
I'm having a problem with processing an Windows Outlook Express '.dbx'
file.
The script I've written to cut down the file to plain text works a treat
on the RISC OS port of Perl5.... but when I run it on the nsPerl port
installed on my friends PC it appears to choke on bytes containing the
value 0x1A. If these bytes are removed in a text editor, all then goes
well on the PC.
Not having any experience with PC/Windows I'm at a loss as to how to
overcome this. My script runs until it encounters the first 0x1A and
appears to go no further.
I know this is somewhat off topic for a RISC OS Perl list but hope
someone will have pity on me!
Best regards, Philip.
Script:
(The first substitution is for odd 16 bytes of scribble that appear
within the email text.)
#!perl -w
open INFILE, "<emails.dbx" or die "Cannot read input file: $!";
open OUTFILE, ">filtrd.txt" or die "Cannot create output file: $!";
while (<INFILE>) {
s/.....\002\000\000........//g;
s/[^ -~]+//g;
print OUTFILE "$_\n";
}
close INFILE;
close OUTFILE;