Saving array to a file

W

Whodat

I have parsed some data from another website, and I would like to save the
data to a file so that I can link it to an access db.
The data is in an array and I cant seem to find the right code to get it to
save?

Here is what I have:

<%

Set ObjHttp = Server.CreateObject("Msxml2.XMLHTTP")
objHttp.Open "GET",
"http://www.tsn.ca/nba/Statistics.as...season=2005&type=player&endRow=520&startRow=1",
false
objHttp.Send
MyHTML = objHttp.ResponseText
Set objHttp = Nothing


MyVar = MID(MyHTML, instr(1, MyHTML, "bgcolor=""#F7EDE0""")-32, LEN(MyHTML))
MyVar = MID(MyVar, 1, instr(1, MyVar, "</table>")-1)


Dim myArray(17)
Dim ii 'col count


Do While instr(1, MyVar, "<tr") > 0
'// Now extract the 'record' from the table (like above code)
MyRec = MID(MyVar, instr(1, MyVar, ">")+1)
MyRec = MID(MyRec, 1, instr(1, MyRec, "</tr>")-1)
'// Now we should be left with all the <td>'s
ii = 0
Do while instr(1, MyRec, "<td") > 0
myValue = MID(MyRec, instr(1, MyRec, ">")+1)
myValue = MID(myValue, 1, instr(1, myValue, "</td>")-1)
'// We have successfully got a value from a <td>!
'// Maybe at this point you could load it into an array:
myArray(ii) = myValue
'// Now we have to clean the MyRec string up
MyRec = MID(myRec, instr(1, myRec, "</td>")+5)
ii = ii + 1
Loop

'Here it is just dumped to the page, I would like to save it to a file...
response.Write Join(myarray,",") & "<br>"

'// Now we have to trim up the main string
Myvar = MID(MyVar, instr(1, MyVar, "</tr>")+5)

Loop
%>

Thanks for reading
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top