View Full Version : Reading text into table from URL
Digoind
02-13-2005, 10:53 PM
I apologise if this has been answered before. I am an experienced programmer but new to this exciting piece of software.
I need exactly what TextFile.ReadToTable(path) does but the text file needs to be on a web server. TextFile.ReadToTable("http://...") does not seem to work and the Web object doesn't look like doing the job, so what is the answer? :huh
Cheers,
JG
Dermot
02-13-2005, 11:01 PM
Hi JG
You can use the HTTP.Download action to download the text file to the Temp folder for example and then read it to a table.
HTTP.Download("http://www.yoursite.com/TextFile.txt", _TempFolder .. "\\TextFile.txt", MODE_BINARY, 60, 80, nil, nil, nil);
Then read it into a table.
tbl = TextFile.ReadToTable(_TempeFolder .. "\\TextFile.txt");
Hope that helps
Dermot
Digoind
02-13-2005, 11:31 PM
Thanks a lot for your help :yes . Might be a good idea for the crew here to include the option to stipulate a URL as parameter to TextFile.ReadToTable() in a future version . This kind of transparency should really be standard.
Cheers,
JG
longedge
02-14-2005, 09:52 AM
HTTP.Download couldn't IMO be any more 'transparent'. Does what it says on the packet doesn't it? :)
Thank goodness that you don't have to be a programmer to use AMS - I'd be out in the cold for sure :D
jwarrent
02-23-2005, 11:38 AM
I have a couple questions related to this.. I was looking for a solution to this very problem and stumbled upon the 'download' method myself, which works great. However, what I'm attempting to do is sort through all the data in the HTML that I download in order to find certain results. The HTML file is quite large due to the data being from an online database; it's about 1 MB in size. Generating that table takes quite a long time. I realize there are many other ways to go about this without using AMS, but I'm a non programmer using it to develop tools for our studio, and it works wonders so our paid programmers don't have to spend time on trivial tools.
My question is two-fold.. is there another method within the confines of AMS to speed this process and will it be possible in the future for AMS to support searching through the file directly to find results rather than reading it to a table first?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.