pulling plain text into something I can work with

M

middletree

The site, which is almost finished, is at
http://site234.webhost4life.com/crgmdal7/

If you click most of the links in the gold nav bar, they will take you to
various places within the site. But if you select the one called "Loads", it
takes you to http://www.crgm06.com/aval.txt, which I have opened into a new
window. As you can see, it's a plain text file, and it is on a different
domain, which I have no control over. The data in there changes all the
time.

Is there a way I can import this into one of the pages I have control over,
and parse it out and display it the way I want? I've never worked with
importing plain text that's generated on the fly before.

Using Classic ASP, have SQL Server or Access available, but not using it for
anything else on the side.
 
R

Ray Costanzo [MVP]

There are probably a number of ways that you can this. The first one that
comes to my mind, is this.

That text file is of the fixed-length variety. If that length always stays
the same, which I'm going to imagine it does, you could try

1. http://www.aspfaq.com/show.asp?id=2173 to grab the text from the site
2. Save the .ResponseText to a file using the File Scripting Object
3. Use ADO to query out a recordset of the data.

Check out this page about ADO and text files.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting03092004.asp

Really, this .txt page you point to is an excellent candidate for RSS, but
well, that's probably out of the scope of what you can control if that's not
your site! :]

Ray at work
 
M

middletree

Really, this .txt page you point to is an excellent candidate for RSS, but
well, that's probably out of the scope of what you can control if that's not
your site! :]

Ray at work


I'll try your suggestions. Hope it's clear that the blue site is mine. But
that txt one is not.

And what's RSS?
 
R

Ray Costanzo [MVP]

I'll try your suggestions. Hope it's clear that the blue site is mine. But
that txt one is not.

Yes, that was clear! :]

And what's RSS?

That's when a page returns data in XML format and you can, programatically,
pull in that "data feed," and do whatever you want with it, such as applying
an XSLT style sheet to it and displaying it, or just using the XML as a data
source for some other purpose.

Ray at work
 
D

Donald Grover

You could download file when a page is selected and using FSO read one line
at a time and place it in a table.
It looks like it is tab delimited so you could slice and dice into columns
during table insertion.
Or, what I would be doing is using a script to place the details in an xml
file once a day , then reading xml file for client display.
Don
 

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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top