Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-20-2007, 02:58 PM   #1
Beta Member
 
Join Date: Aug 2007
Posts: 5
Question Need a program which would...

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
__________________

vladtess is offline   Reply With Quote
Old 08-20-2007, 05:33 PM   #2
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Need a program which would...

Hey,

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

PHP Code:
<?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..
__________________

DJ Stephen is offline   Reply With Quote
Old 08-20-2007, 06:09 PM   #3
Beta Member
 
Join Date: Aug 2007
Posts: 5
Default Re: Need a program which would...

It does work, thank you so much!!!
vladtess is offline   Reply With Quote
Old 08-21-2007, 03:07 AM   #4
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Need a program which would...

That's ok.. Glad it worked for you.. never works for me..hehe..Only kidding!
DJ Stephen is offline   Reply With Quote
Old 08-23-2007, 07:49 PM   #5
In Runtime
 
AllThingsSacred's Avatar
 
Join Date: Aug 2007
Posts: 302
Default Re: Need a program which would...

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.
__________________
Patrick Moore
Born London, Live London, Die London
As a Londoner, I exercise my God given Right to do as I please
AllThingsSacred is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0