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 2 of 6 Topic 2219 of 2297
Post > Topic >>

Re: translate html codes to ascii chars

by pk <pk@[EMAIL PROTECTED] > Apr 9, 2008 at 11:37 AM

tomekl wrote:

> Hello!
> 
> I need to replace html codes with ascii chars, so for
> 
> '&#73;&#74;aaaa&#75;'
> 
> output should be:
> 
> 'IJaaaaK'

Don't know whether that can be done with awk, however if you have recode:

$ echo '&#73;&#74;aaaa&#75;' | recode "$type"

where $type is an appropriate value for your HTML input (for example h1,
but
see the man for details).

$ echo '<p>&#73;&#74;aaaa&#75;</p>' | recode h1
<p>IJaaaaK</p>

-- 
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
 




 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 Sun Jul 6 20:33:47 CDT 2008.