[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"
- Retirar tags html, César Vianna, 2008/01/30
- Re: [shell-script] Retirar tags html,
Tiago Barcellos Peczenyj <=