RE: HTML to Text
- From: rjf@xxxxxxxxxxxxxx (Russ Foster)
- Date: Tue, 2 May 2006 15:45:06 -0500
-----Original Message-----
<HTML>
<HEAD>
<TITLE>Bin Server</TITLE>
</HEAD>
<BODY>
<p>Data that I need</p>
<p>Data that I need</p>
</BODY>
</HTML>
I want the output to just be lines of "Data that I need" stored in a
string, that I can work on each line one at a time, or in an array or
something like that would be great.
I would first strip out everything from the start to <BODY>, then everything
from </BODY> to the end...
$test2convert =~ s/^.*\<BODY\>// ;
$test2convert =~ s/\<\/BODY\>.*$// ;
Remove any existing newlines...
$test2convert =~ s/\n// ;
Are you sure that the paragraph tags are always paired up? If so, you could
always strip out the <p>s and substitute the </p> with \n . If you don't
have control over the input, then this would be a big assumption to make.
But it might give you ideas to start with based on how complex the data
is...
Good luck.
-r
.
- References:
- HTML to Text
- From: Scott Taylor
- HTML to Text
- Prev by Date: Re: using "our" across blocks
- Next by Date: RE: HTML to Text
- Previous by thread: Re: HTML to Text
- Next by thread: RE: HTML to Text
- Index(es):
Relevant Pages
|