Solved

Classic asp read from url

Posted on 2014-12-09
2
216 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 142

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Summernote required 3 141
Using querystring in a hyperlink 3 51
Button to go back 3 25
Connection to multiple databases 13 19
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

772 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