Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading an ASP File
Message
From
16/03/2004 04:11:06
 
 
To
15/03/2004 10:07:36
Mike Smith
Doncaster Office Services
Oakville, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00886014
Message ID:
00886613
Views:
10
Hi,

Sounds like you're stuck with a pretty clunky approach. Since the columns in the HTML table are not differentiated I think you'll have to resort to old-fashioned HTML scraping. Something like (from the example you gave):
LOCAL lcString,lni,lni2,lcRec
USE myTable
lcString=STREXTRACT(FILETOSTR("myHTMLFile.html"),"<TBODY>","</TBODY>")
lcString = SUBSTR(lcString,AT("<TR>",lcString,2))  && Skip headings

FOR lni = 1 TO OCCURS("<TR>",lcString)
  * Parse a record
  APPEND BLANK IN myTable
  lcRec = STREXTRACT(lcString,"<TR>","</TR>",lni)
  FOR lni2 = 1 TO 7
    REPLACE (FIELD(lni2)) WITH STREXTRACT(lcRec,"<TD>","</TD>",lni2)
  ENDFOR
ENDFOR
You'd need a DBF set up in the right format (all strings as it stands) and it will, of course, break if the HTML changes. I'd have thought the .NET guys could cobble something together to deliver this in valid XML in 10 minutes....

HTH, Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform