Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: MLUG Members <EMAIL:PROTECTED>
- Subject: Re: [MLUG] simple perl one-liner question
- From: Mike Miller <EMAIL:PROTECTED>
- Date: Thu, 12 Apr 2007 20:55:43 -0500 (CDT)
- Delivery-date: Thu, 12 Apr 2007 20:56:20 -0500
- Envelope-to: EMAIL:PROTECTED
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED>
- Reply-to: MLUG Members <EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
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