Need a program which would...

vladtess

Beta member
Messages
5
Hey guys.

I have this huge file... an html file which consists of similar tags. Basically it looks like this:

Code:
<tr><td class=bodycopy>A S P Ventures</td>.........

<tr><td class=bodycopy>A. Schulman</td>..........

<tr><td class=bodycopy>A.D.A.M.</td>................

If you noticed, there are different data between <td class=bodycopy> and </td>. Now the file itself if huge, above is just part of it. I need a way of getting only that data in between the tags out into a discrete file. Anyone knows how this may be achieved and what language you would prefer to use? Of if there is software that exists that does it.


Thanks a lot in advance,

Vlad
 
Hey,

What you would need is a php script, I can make you on below and echo them all out.

PHP:
<?php
$html = file_get_contents(yourfile.html);
$matches = array();
preg_match_all("/<td><td class=bodycopy>(.*?)<\/td>/mis", $html, $matches);
foreach($matches[1] as $key => $name) {
echo $name;
}
?>

Hope that helps.. Tell me if it doesn't work..
 
Another approach would be to write a parser in a language like C++ or Java but that is probably far too complicated for your needs.
 
Back
Top Bottom