extracting data from a csv file

knappster

Active member
Joined
Nov 13, 2006
Messages
42
Programming Experience
Beginner
Hi,
On the yahoo finance section you can enter an address to get up to date share prices. For example if you enter the address -

http://uk.old.finance.yahoo.com/d/quotes.csv?s=BARC.L&e=.csv

you will get the share price of Barclays as a .csv file. I want to do this in code, so that I construct the address to get different quotes for different companies and extract the second and third values from the resulting csv file.
What's the best way of going about this??

Cheers for your help!
 
You can also do this:
VB.NET:
Dim web As New Net.WebClient
Dim text As String = web.DownloadString("http://uk.old.finance.yahoo.com/d/quotes.csv?s=BARC.L&e=.csv")
Dim fields() As String = text.Split(",")
MsgBox(fields(1) & vbNewLine & fields(2))
I didn't find any info about regulations about such use of Yahoo.
 
The only issue I would say about automatic extraction from a csv file is that you have to be careful they do not change the data format on you.

Many a time I have automatic extraction to find I am have to change the code all of the time due to the fact the site etc keeps changing fields about etc in the data.

Andy
 
Back
Top