Solved

Classic asp read from url

Posted on 2014-12-09
2
220 Views
Last Modified: 2014-12-09
Hi.

I need to read all lines from a csv file online.

Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlhttp.Open "GET", "http://www.url.dk/files/file.csv" , False
xmlhttp.Send
txt = xmlhttp.responseText
Set xmlhttp = Nothing

Now i have the file in the variable txt.
How does i read from txt now.

something like http://www.w3schools.com/asp/met_readall.asp
But I cant read from stream.

In asp.net it´s easy, just like:
StreamReader SR = new StreamReader(txt, Encoding.Default);
But how is this possible in classic?
0
Comment
Question by:bongii
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40488547
in classic asp, you would just "split" the value of txt by the carriage/return character

LineArray = Split(txt , chr(10))

and then you can loop from lBound(LineArray) to uBound(LineArray) to take each line individually
0
 

Author Comment

by:bongii
ID: 40488568
Arhh yes of couse :) Thx man
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Server Timeout with Loop 6 59
key press alert 2 42
IIS components 2 35
Sending ASP to server side 8 32
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question