shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Substituicao dentro .html - apenas o href


From: Thobias Salazar Trevisan
Subject: Re: [shell-script] Substituicao dentro .html - apenas o href
Date: Mon, 14 Apr 2003 14:02:07 -0300 (BRT)

ae charles,

On Mon, 14 Apr 2003, Charles Silveira wrote:

> Mas alguns dos arquivos que recebo tem o código HTML
> (conforme a tabela abaixo) no lugar do caracter
> acentuado. Pergunto: Como prever que além de "á" posso
> desejar substituir "á" ou "aacute" por "a"?
>
> Alguém tem alguma idéia?

bom, deve ter uma alternativa mais otimizada que esta, mas
para uma segunda feira acho que ta legal :)
Crie um script sed com todos os codigos. Assim:

$ cat script.sed
#!/bin/sed -f

s/á\|aacute/a/g
s/ê\|ecirc/e/g
......

$ cat x
<a href="teste &#234; ecirc">Informações</a>
href="teste2 &#225;aacute>Informações</a>

$ ./script.sed < x
<a href="teste e e">Informações</a>
href="teste2 aa>Informações</a>

PS: vai trocar em todo o arquivo, se quiser soh entre as TAGs
html use a mesma tatica que vc esta usando no outro sed.

falow

thobias
-------
echo 24883721290304465999833114447114149701898P | dc
-------
http://www.lcp.coppe.ufrj.br/~thobias

____________________________
|
| Against - HTML Mail
| Against - MS ATTACHMENTS
|
----------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]