In article
<e7342bbc-7909-474f-ae75-18c0b272494c@[EMAIL PROTECTED]
>,
tomekl <tomek@[EMAIL PROTECTED]
> wrote:
>I need to replace html codes with ascii chars, so for
>
>'IJaaaaK'
>
>output should be:
>
>'IJaaaaK'
The following is inefficient, but should give you an idea of a general
approach
you could use to carry out this transformation. It only deals with
numeric
code character entities, as in your example text.
echo "IJaaaaK" | gawk '
{
while (match($0,/&#[0-9]+;/))
$0 = substr($0, 1, RSTART-1) sprintf("%c", substr($0, RSTART+2)+0) \
substr($0, RSTART+RLENGTH)
print
}'
John
--
John DuBois spcecdt@[EMAIL PROTECTED]
KC6QKZ/AE
http://www.armory.com/~spcecdt/


|