table+to+CSV

Convert HTML ",tblBeg) tblData$    = mid$(htmlData$,tblBeg,(tblEnd - tblBeg) + 8) lineBeg        = 0 lineEnd        = instr(tblData$," ",lineBeg)

while lineEnd > 0 lineData$   = mid$(tblData$,lineBeg - 1,(lineEnd - lineBeg) + 1) lineData$   = strip$(lineData$) lineData$   = strRep$(lineData$," ",""",""") lineData$   = strRep$(lineData$," ",""",""") lineData$   = tags$(lineData$,"") lineData$   = strRep$(lineData$," "," ") lineData$   = strRep$(lineData$,"&amp;","and")

print """";left$(lineData$,len(lineData$) -2) print #f, """";left$(lineData$,len(lineData$) -2)

lineBeg       = lineEnd + 1 lineEnd       = instr(tblData$," ",lineBeg) wend print "- end --" print #f, "" goto [nxtTbl]

[endTbl] close #f print "--- That's all folks ---" wait

' - ' strip junk ' - FUNCTION strip$(str$) strip$ = "" for i = 1 to len(str$) a$ = MID$(str$,i,1) a = ASC(a$) if a > 31 then if a < 127 then if a$ <> "'" then if a$ <> """" then strip$ = strip$ + a$              end if             end if           end if        end if    next i END FUNCTION

' ' string replace rep str with ' FUNCTION strRep$(str$,rep$,with$) ln   = len(rep$) ln1   = ln - 1 i   = 1 while i <= len(str$) if mid$(str$,i,ln) = rep$ then strRep$ = strRep$ + with$ i = i + ln1 else strRep$ = strRep$ + mid$(str$,i,1) end if i = i + 1 WEND END FUNCTION

' ' Replace HTML with$ ' FUNCTION tags$(tag$,with$) i   = instr(tag$,"<") j   = instr(tag$,">",i) WHILE j > i   tag$    = left$(tag$,i - 1) + mid$(tag$,j + 1) i   = instr(tag$,"<") j   = instr(tag$,">") WEND tags$   = tag$ END FUNCTION code