in reply to XML file won't parse properly
Coincidentally, I was talking about this sometime back on the chatterbox..
I got this snippet from tye, I think, who in turn said that jcwren had told him :o)
here goes.. in Perl, you can use regular expressions to match and strip characters..
$line =~ tr/\x80-\xff//d; $line =~ tr/\x00-\x1f//d; $line =~ s/[\r\n\t]//d;
The first two lines strip high end control characters from your file and the third line replaces all whitespace and new line characters..
for more information on what this is, and how its done, I'd suggest you look at this page..
HTH
Update: fixed the regexps.. many thanks to chromatic
|
|---|