Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: translate h...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 2219 of 2317
Post > Topic >>

Re: translate html codes to ascii chars

by tomekl <tomek@[EMAIL PROTECTED] > Apr 11, 2008 at 02:29 AM

On 9 Kwi, 20:36, spce...@[EMAIL PROTECTED]
 (John DuBois) wrote:
> In article
<e7342bbc-7909-474f-ae75-18c0b2724...@[EMAIL PROTECTED]
>,
>
> tomekl =A0<to...@[EMAIL PROTECTED]
> wrote:
> >I need to replace html codes with ascii chars, so for
>
> >'&#73;&#74;aaaa&#75;'
>
> >output should be:
>
> >'IJaaaaK'
>
> The following is inefficient, but should give you an idea of a general
app=
roach
> you could use to carry out this transformation. =A0It only deals with
nume=
ric
> code character entities, as in your example text.
>
> echo "&#73;&#74;aaaa&#75;" | gawk '
> {
> =A0 =A0 while (match($0,/&#[0-9]+;/))
> =A0 =A0 =A0 =A0 $0 =3D substr($0, 1, RSTART-1) sprintf("%c", substr($0,
RS=
TART+2)+0) \
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 substr($0, RSTART+RLENGTH)
> =A0 =A0 print
>
> }'
>
> =A0 =A0 =A0 =A0 John
> --
> John DuBois =A0spce...@[EMAIL PROTECTED]
 =A0KC6QKZ/AE
=A0http://www.armory.com/~s=
pcecdt/

Brilliant! Thank you !!!
 




 6 Posts in Topic:
translate html codes to ascii chars
tomekl <tomek@[EMAIL P  2008-04-09 02:01:40 
Re: translate html codes to ascii chars
pk <pk@[EMAIL PROTECTE  2008-04-09 11:37:59 
Re: translate html codes to ascii chars
tomekl <tomek@[EMAIL P  2008-04-09 02:45:41 
Re: translate html codes to ascii chars
pk <pk@[EMAIL PROTECTE  2008-04-09 12:23:53 
Re: translate html codes to ascii chars
spcecdt@[EMAIL PROTECTED]  2008-04-09 13:36:26 
Re: translate html codes to ascii chars
tomekl <tomek@[EMAIL P  2008-04-11 02:29:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:33:57 CDT 2008.