At 07:52 28-1-03, you wrote:
Hi All Guru's here,
Sorry, i am not a guru. I do have visions to become the enigmatic leader of a sekte but i think that's slightly out of scope here.

(Actually i have 500 html files containing this table struction,and need to read all 500 files and convert them to DB schema or XML format)
I had to do something similar. Unfortunately that code is not very readable. Maybe you can find something readable in a script library, look for 'html page ripper' or 'ripping an html page'.

What i did was i first cleaned up all HTML files in one sweep with the Search and Replace in Multiple Files option of UltraEdit. This to remove the head section which would bother me, and to remove newlines and tabs and double spaces.

Then i selected the keywords (or key sentences) that came back in all files that would announce the coming of a new data element. In your case they are easy to distinguish: add the <b> tag to the search sequence. In my files the keywords where luckily very unique.
I made an array of these keywords.
I think i did this: $array['name']['key']='<b>Name</b>';

Then i read in the files one by one, and with each file content i would go through the content. I would look for the start of every keyword or sentence (strpos) and find the end of it by looking for the next </td> tag. This value i would clean up and then add as value to the array. Maybe $array['name']['value']=trim($result);

From this array it was easy to build a query.

Next file.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to