Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Special Characters list

by ZWcarp (Beadle)
on Jun 15, 2011 at 22:38 UTC ( #909871=note: print w/ replies, xml ) Need Help??


in reply to Re: Special Characters list
in thread how to remove

Ok I looked up the code...but the following doesn't seem to be working

perl -i -pe 'tr/\xe9/FIX/d' test.txt

or

perl -i -pe 'tr/\00233/FIX/d' test.txt

What am I doing wrong? Thanks so much for the help you guys are great


Comment on Re^2: Special Characters list
Select or Download Code
Re^3: Special Characters list
by ikegami (Pope) on Jun 15, 2011 at 23:06 UTC

    tr/\xe9/FIX/d is the same as tr/\xE9/F/ and convert chr(0xE9) to "F".

    tr/\00233/FIX/d is the same as tr/3\002/IF/ and converts chr(002) to "F" and "3" to "I".

    What am I doing wrong?

    What are you trying to do?

    You previously alluded that you wanted to remove "é" characters that were encoded as E9.

    perl -i -pe 'tr/\xE9//d' yourprogram.pl

    But the "FIX" in the new code seems to indicate you want something else.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://909871]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-12-23 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls