Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: PERL UNIX and strangeness and char conversion

by tybalt89 (Prior)
on Jan 18, 2021 at 19:54 UTC ( #11127070=note: print w/replies, xml ) Need Help??


in reply to PERL UNIX and strangeness and char conversion

""more" and those editors are all correct. They are just showing a different representation of the same unprintable character.

perl -pe 'tr/\x80-\xff/?/' <oldfile >convertedfile

There. I've converted all that strangeness to a plain ASCII ? just like you asked.

Replies are listed 'Best First'.
Re^2: PERL UNIX and strangeness and char conversion
by Anonymous Monk on Jan 18, 2021 at 21:55 UTC

    OK! I THINK I GET IT perl -pe 'tr/\x93-\x94/"/' <INFILE >OUTFILE Inserts the " perl -pe 'tr/\x97/,/' <INFILE >OUTFILE Inserts the , perl -pe 'tr/\x91-\x92/'/' <INFILE >OUTFILE Croaks. If I insert "\" to escape the second ' IT STILL CROAKS! What is special about \x91 and \x92 in the above statement? At least I made progress this time...

      The bash shell does not take escapes, try

      perl -pe 'tr/\x91-\x92/\x27/' <INFILE >OUTFILE
      instead.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2021-03-01 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?