On 1/10/07, Beginner <[EMAIL PROTECTED]> wrote:
I am trying to parse a file and extract some names. The data has come with some odd characters in, and these characters are sandwiched in the middle of the string I am trying to extract.
You can use Perl to tell you what the odd characters are. I often use an ASCII table and unpack: print unpack("H*", $data), "\n";
MIKE \A0 \A0\A0HOLLINGSHEAD/JIM REED
On some systems, character 0xA0 is the non-breaking space.
I am pretty sure this is a job for tr but I can't determine the correct values to use.
It depends upon what you want to replace these characters with. Maybe something like this? tr/\xA0\x20/\x20/s Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/