Solved

Classic asp read from url

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now