Ask a Question related to ASP, Design and Development.
-
Robb Meade #1
Re: format a retrieved text file
"John" wrote ...
Hi John,> I just learned that it is possible to grab a text file from another
> site and display the data on my own site, however when I display the
> data it does not format it correctly. Can anyone please point me in
> the direction of a tutorial or help me with the code below.
I've often wanted to know how to do this also, so cheers for the code, might
come in handy...
With regards to the formatting it looks like its dropped all of the carriage
returns and stuff, just wondered, what would happen if you grabbed the file
from their site and then saved it as a text file on your own - when you open
the text file then, do you still have the correct formatting, or is it being
lost when the XML stuff reads it in?
Robb
Robb Meade Guest
-
Format text in text area
I have a text area on a form and I need a way to recognize when a user enters a line break. I want to send the data in the box to a database and... -
File Viewer / Bloated file sizes / What is the best file format?
I would like to find a viewer capable of looking at the main Adobe formats as well as the standard formats such as JPG and WMF ... but yet the only... -
Newbie trying to cleanup/format text file
Hi all: I'm trying to cleanup and format this text file of user names, so that I have one column of user names. Here's the text file: The... -
File-format Module Cannot Parse the File?
A family member is sending me photos in Compu-Serve GIF format and they are averaging 3-4 MB per photo. I don't think she knows about compression.... -
text format
Hi, I use <textarea> input more than one paragraph to the database, whose field type is set to "text". Then I retrieve it to display in... -
Robb Meade #2
Re: format a retrieved text file
"John" wrote ...
[snip]
Hi John,
In addition to that, I've just tried the same code with the same file and
got what you had...however, I then pointed it to a text file on my own
server...
[url]http://80.195.95.105/xml-get-test.asp[/url]
the results came out fine...maybe its something to do with the way that
their text file has been written, maybe there are no carriage returns (is
that possible) in their file?
Try it with some of your own text files and see what happens...as far as the
code goes it 'seems' to be working correctly.
Regards
Robb
Robb Meade Guest
-
John #3
format a retrieved text file
I just learned that it is possible to grab a text file from another
site and display the data on my own site, however when I display the
data it does not format it correctly. Can anyone please point me in
the direction of a tutorial or help me with the code below.
John
<%
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET",
"http://iwin.nws.noaa.gov/pub/data/text/FZUS53/KCLE.TXT", False
xml.Send
Response.Write xml.responseText
Set xml = Nothing
%>
This is a sample of what I am getting back
FZUS61 KCLE 291114 AAA GLFLE LEZ160-291400- OPEN LAKE FORECAST FOR
LAKE ERIE...UPDATED NATIONAL WEATHER SERVICE CLEVELAND OH 700 AM EDT
SUN JUN 29 2003 UPDATED FOR SHOWERS LAKE ERIE FORECAST BEYOND FIVE
NAUTICAL MILES FROM SHORE .SYNOPSIS...A COLD FRONT NORTHWEST OF LAKE
ERIE WILL MOVE SOUTHEAST ACROSS THE LAKE THIS AFTERNOON AND EARLY THIS
EVENING. HIGH PRESSURE 30.10 INCHES OVER THE CENTRAL PLAINS WILL BUILD
ACROSS THE LAKE BEHIND THE FRONT MONDAY AND TUESDAY. THE HIGH WIL
this is what i get if i connect to the page directly (and what I would
like to see with my results
FZUS61 KCLE 291114 AAA
GLFLE
LEZ160-291400-
OPEN LAKE FORECAST FOR LAKE ERIE...UPDATED
NATIONAL WEATHER SERVICE CLEVELAND OH
700 AM EDT SUN JUN 29 2003
UPDATED FOR SHOWERS
LAKE ERIE FORECAST BEYOND FIVE NAUTICAL MILES FROM SHORE
SYNOPSIS
A COLD FRONT NORTHWEST OF LAKE ERIE WILL MOVE SOUTHEAST
ACROSS THE LAKE THIS AFTERNOON AND EARLY THIS EVENING. HIGH
PRESSURE 30.10 INCHES OVER THE CENTRAL PLAINS WILL BUILD ACROSS THE
LAKE BEHIND THE FRONT MONDAY AND TUESDAY. THE HIGH WILL MOVE EAST
OF THE AREA WEDNESDAY BUT SHOULD CONTINUE TO INFLUENCE WEATHER OVER
THE LAKE THROUGH THURSDAY.
John Guest
-
Robb Meade #4
Re: format a retrieved text file
"Robb Meade" wrote ...
correction - it looked like it - but then I changed the contents of the text> the results came out fine...
file and now it isnt...its definately something to do with the carriage
returns!
Sorry :(
Robb Meade Guest
-
John #5
Re: format a retrieved text file
It is working now, thanks for the help
[url]http://www.ohioanglers.com/nearshore.asp[/url]
Not sure why the <xmp> is showing up at the beginning of the file but
I will mess with it.
John Guest
-
Evertjan. #6
Re: format a retrieved text file
John wrote on 29 jun 2003 in microsoft.public.inetserver.asp.general:
<%> I just learned that it is possible to grab a text file from another
> site and display the data on my own site, however when I display the
> data it does not format it correctly. Can anyone please point me in
> the direction of a tutorial or help me with the code below.
>
> John
>
> <%
> Response.Buffer = True
> Dim objXMLHTTP, xml
>
>
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
>
> xml.Open "GET",
> "http://iwin.nws.noaa.gov/pub/data/text/FZUS53/KCLE.TXT", False
>
> xml.Send
>
> Response.Write xml.responseText
>
> Set xml = Nothing
> %>
>
Response.Buffer = True
url="http://iwin.nws.noaa.gov/pub/data/text/FZUS53/KCLE.TXT"
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET",url, False
xml.Send
t=xml.responseText
t=replace(t,vbcr&vbcr,vbcr)
Response.Write "<pre>"&t&"</pre>"
Set xml = Nothing
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest
-
Robb Meade #7
Re: format a retrieved text file
"John" wrote..
Hi John,> With this last piece you posted are you still reading from a text file
> on your local server or reading from the remote url?
I tried it initially with my local txt file, and then changed the code back
to what you'd submitted and added the 2 lines I mentioned- this was then
using your remote file, and it spaced it all out correctly as you wanted
etc.
Robb
Robb Meade Guest



Reply With Quote

