The UNIX and Linux Forums  


Go Back   O UNIX e Linux Forum > Sistemas Operativos > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo Linux, PCLinuxOS. Todas as perguntas Linux aqui!

Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
Fio Thread Starter Fórum Respostas Última postagem
Remover tags HTML com bash dejavu88 Programação Shell Script e 4 05-22-2008 02:58
Como complemento tags HTML com SED DocBrewer Programação Shell Script e 3 04-25-2008 10:40
tags html dunryc Programação Shell Script e 3 11-29-2007 06:14
Como dividir arquivo de tags dentro arquivo? spookyrtd99 Programação Shell Script e 1 07-31-2006 01:50
Automatizado de substituição HTML Tags nem_kirk Sun Solaris 1 11-17-2005 01:24

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
Linkback Thread Tools Pesquisar este Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-23-2007
btech_raju
Convidado
  
 

Posts: n / a
Bits: 0 [Bancária]
Como remover apenas tags html dentro de um arquivo?

Todas oi,

Tenho seguinte exemplo arquivo

Quero remover todas as tags html apenas,

Input File:

<html>
<head>
<title> Software Solutions Inc., </ title>
<meta http-equiv\u003d"Content-Type" content\u003d"text/html; charset\u003diso-8859-1">
</ head>
<body bgcolor\u003dwhite leftmargin\u003d"0" topmargin\u003d"0" marginwidth\u003d"00" marginheight\u003d"0" class\u003dNormalFont>
<table ID\u003d"Table2" Bordercolor\u003dblack border\u003d2 cellspacing\u003d2 cellpadding\u003d2>
<TR> <TD Colspan\u003d4 align\u003d"left" bgcolor\u003d"yellow"> <font color\u003dblue> <b> Iswar Ramamoorthy </ b> </ font> </ td> </ TR>
<tr>
<td align\u003d"center"> <b> Data </ b> </ td>
<td align\u003d"center"> <b> total de horas </ b> </ td>
<td align\u003d"center"> <b> Total EM Hora </ b> </ td>
<td align\u003d"center"> <b> Total Break Horas </ b> </ td>
</ tr>


</ table>


<table ID\u003d"Table2" Bordercolor\u003dblack border\u003d2 cellspacing\u003d2 cellpadding\u003d2>
<TR> <TD Colspan\u003d4 align\u003d"left" bgcolor\u003d"yellow"> <font color\u003dblue> <b> Aman Jain </ b> </ font> </ td> </ TR>
<tr>
<td align\u003d"center"> <b> Data </ b> </ td>
<td align\u003d"center"> <b> total de horas </ b> </ td>
<td align\u003d"center"> <b> Total EM Hora </ b> </ td>
<td align\u003d"center"> <b> Total Break Horas </ b> </ td>
</ tr>


</ table>


<table ID\u003d"Table2" Bordercolor\u003dblack border\u003d2 cellspacing\u003d2 cellpadding\u003d2>
<TR> <TD Colspan\u003d4 align\u003d"left" bgcolor\u003d"yellow"> <font color\u003dblue> <b> Anilkumar Kaandukuri </ b> </ font> </ td> </ TR>
<tr>
<td align\u003d"center"> <b> Data </ b> </ td>
<td align\u003d"center"> <b> total de horas </ b> </ td>
<td align\u003d"center"> <b> Total EM Hora </ b> </ td>
<td align\u003d"center"> <b> Total Break Horas </ b> </ td>
</ tr>


<tr class\u003dnormalfont>
<td align\u003d"center"> 11/16/2007 </ td>
<td align\u003d"center"> 1:16:0 </ td>
<td align\u003d"center"> 01:16 </ td>
<td align\u003d"center"> 0 </ td>
</ tr>

</ table>


<table ID\u003d"Table2" Bordercolor\u003dblack border\u003d2 cellspacing\u003d2 cellpadding\u003d2>
<TR> <TD Colspan\u003d4 align\u003d"left" bgcolor\u003d"yellow"> <font color\u003dblue> <b> Arun Sivaraman </ b> </ font> </ td> </ TR>
<tr>
<td align\u003d"center"> <b> Data </ b> </ td>
<td align\u003d"center"> <b> total de horas </ b> </ td>
<td align\u003d"center"> <b> Total EM Hora </ b> </ td>
<td align\u003d"center"> <b> Total Break Horas </ b> </ td>
</ tr>

Meu resultado esperado:

Software Solutions Inc

Iswar Ramamoorthy

Data
O total de horas
Total em Tempo
Total Break Horas

Aman Jain

Data
O total de horas
Total em Tempo
Total Break Horas

Anilkumar Kaandukuri

Data
O total de horas
Total em Tempo
Total Break Horas

11/16/2007
1:16:0
01:16
0

............
...........

etc ...........
  #2 (permalink)  
Old 11-23-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
viciado
  
 

Join Date: Jan 2007
Localização: Варна, България / Milano, Italia
Mensagens: 2.915

Código:
sed -n '/^$/!{s/<[^>]*>//g;p;}' filename

Ou, com um pouco diferente de saída:


Código:
lynx --dump filename

(o arquivo deve ter htm [l] extensão)

Ou use html2text

Última edição por radoulov; em 11/23/2007 12:17..
  #3 (permalink)  
Old 11-23-2007
btech_raju
Convidado
  
 

Posts: n / a
Bits: 0 [Bancária]
Todos os comandos estão a fazer bem,

sed -n'/^$/!{ s /<[^>]*>// g; p;) 'filename

Explicar o que precede sed comando

Obrigado,
Thangaraju.

Última edição por btech_raju; em 11/23/2007 12:39..
Closed Thread

Marcadores

Thread Tools Pesquisar este Thread
Pesquisar este Thread:

Pesquisa Avançada
Display Modes Esta taxa Thread
Esta taxa Thread:

Destacamento Regimento
Você não pode postar novas threads
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar suas postagens

BB code é Ligado
Smilies são Ligado
[IMG] código é Desligado
Código HTML é Desligado
Trackbacks são Ligado
Pingbacks são Ligado
Refbacks são Ligado




Todos os horários são GMT -4. A hora é agora 08:45.


Powered by: vBulletinCopyright © 2000 - 2006, Jelsoft Enterprises Limited. Língua Traduções Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
O UNIX e Linux Fóruns Content Copyright © 1993-2009. Todos os Direitos Reserved.Ad Gestão por RedTyger

Content Relevant URLs por vBSEO 3.2.0