FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Alguna funcion que convierta un html en txt
Posts: 225
Joined: Tue Feb 28, 2006 04:25 PM
Alguna funcion que convierta un html en txt
Posted: Wed Nov 19, 2008 07:25 PM

Existe alguna funcion para convertir un archivo html
en archivo de texto libre de etiquetas

Gracias

ME INTERESA FW Y XHB POR SER OPEN SOURCE
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Alguna funcion que convierta un html en txt
Posted: Thu Nov 20, 2008 09:59 PM
Vladimir,

Nosotros usamos esta función para quitar los tags:
function RemoveTags( cText )  // Quita "< ... >" de un texto

   local nStart, nEnd 
   
   while ( nStart := At( "<", cText ) ) != 0
      nEnd = At( ">", SubStr( cText, nStart + 1 ) )
      if nEnd == 0
         nEnd = nStart 
      else
         nEnd += nStart   
      endif   
      cText = If( nStart > 1, SubStr( cText, 1, nStart - 1 ), "" ) + SubStr( cText, nEnd + 1 )
   end
   
return cText
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion