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

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

Re: [shell-script] Retirar tags html


From: Tiago Barcellos Peczenyj
Subject: Re: [shell-script] Retirar tags html
Date: Wed, 30 Jan 2008 21:33:32 -0200

Tente isso:

sed -r 's/<[^>]+>//g' file

Entretanto não vai funcionar se vc tiver algo como
<a
 href="xxx">....

Pois sed não é multilinha ;-)

2008/1/30 César Vianna <address@hidden>:
>
>
> Preciso remover as tags de um html e só imprimir o texto.
>
>  cat teste.html
>
>  <tag1> abc </tag1> <tag2>
>  <tag3> abcdef </tag2></tag3>
>
>  Tentei com:
>
>  sed "s/<.*>\(.*\)/\1/g" teste.html
>
>  mas como o * é guloso, o resultado é vazio.
>
>  tentei assim
>  sed "s/<.*>\(.*\)<\/.*>/\1/g" teste.html
>
>  mas o resultado é apenas a primeira ocorrência
>  abc
>
>  Alguma dica?
>
>  [As partes desta mensagem que não continham texto foram removidas]
>
>  



-- 
Tiago B Peczenyj
Linux User #405772

http://peczenyj.blogspot.com/
"what does not kill us makes us stronger"


reply via email to

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