Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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


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

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

Replies are listed 'Best First'.
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'

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://909871]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-03-23 17:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (294 votes). Check out past polls.