MLUG: Re: [MLUG] simple perl one-liner question
Re: [MLUG] simple perl one-liner question
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Thu, 30 Mar 2006, Mike Miller wrote:

All the Spanish/Portuguese special characters are translated like I described earlier (e.g., \361 instead of ñ), but this does it right:

tree | perl -pe 's/\\([0-9]{3})/chr(oct($1))/eg' | less -r

If you don't have it already, you can get tree here:

http://directory.fsf.org/all/tree.html

I just looked back at these old messages. The funny thing is that the excellent tree program, I now know, has a -N switch that makes the characters come out fine, so I now do this to get what I want:


tree -N | less -r

By the way, Mike808 later suggested, correctly, that [0-7] would be even better than [0-9] because these were octal numbers.

I'm looking back at the old messages because I'm interested in finding a simple way to convert letters A-Z to numbers 1-26. That has to be really easy!

Mike
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members