Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Saving array to a file

Thread Tools

Saving array to a file

Posts: n/a
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

Here is what I have:


Set ObjHttp = Server.CreateObject("Msxml2.XMLHTTP")
objHttp.Open "GET",
" &season=2005&type=player&endRow=520&startRow=1" ,
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

'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)


Thanks for reading

Reply With Quote

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
const and array of array (of array ...) Mara Guida C Programming 3 09-03-2009 07:54 AM
EXCEL question saving a file saving the the first column as read only Luis Esteban Valencia ASP .Net 0 01-06-2005 07:02 PM
Saving DataTable to session vs saving a Custom object. John Kandell ASP .Net 4 12-10-2004 05:08 AM
Saving Images While Saving ASP Pages ! Lovely Angel For You ASP General 1 10-03-2003 12:03 AM
[newbie]saving and reading array of associative array Yvon Thoraval Ruby 5 09-17-2003 07:54 PM