Thread Subject: Using urlread to download data from the web

Subject: Using urlread to download data from the web

From: Magnus Andersson

Date: 11 Nov, 2009 15:27:01

Message: 1 of 7

I would like to directly read financial data from the web and analys it. By using Urlread its possible to fast access the data, but it is put into Matlab as characters without delimiter. For example, if one type

urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lang=SE&fn=ABB&outputmode=5&format=csv&separator=,&lcid=2057&stockid=77151');

A 1x87014 long char is created, however, I would like the data to be stored as a Matrix with the format,

91.90 91.90 89.70 90.35 4212226
90.55 91.95 90.10 91.90 4277414
etc

Do anyone know how to solve that problem?

Subject: Using urlread to download data from the web

From: Ashish Uthama

Date: 11 Nov, 2009 18:50:19

Message: 2 of 7

On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson
<magnusandersson75@gmail.com> wrote:

> I would like to directly read financial data from the web and analys it.
> By using Urlread its possible to fast access the data, but it is put
> into Matlab as characters without delimiter. For example, if one type
>
> urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lang=SE&fn=ABB&outputmode=5&format=csv&separator=,&lcid=2057&stockid=77151');
>
> A 1x87014 long char is created, however, I would like the data to be
> stored as a Matrix with the format,
>
> 91.90 91.90 89.70 90.35 4212226
> 90.55 91.95 90.10 91.90 4277414
> etc
>
> Do anyone know how to solve that problem?

You could parse the string using various string operations.

But seeing that the data is CSV (comma separated values), you could use
URLWRITE to to a local CSV file and then use this command to obtain the
data as a matrix:
d=xlsread('d.csv') (on a windows machine)

Subject: Using urlread to download data from the web

From: Magnus Andersson

Date: 11 Nov, 2009 19:22:04

Message: 3 of 7

"Ashish Uthama" <first.last@mathworks.com> wrote in message <op.u28ul5gwa5ziv5@uthamaa.dhcp.mathworks.com>...
> On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson
> <magnusandersson75@gmail.com> wrote:
>
> > I would like to directly read financial data from the web and analys it.
> > By using Urlread its possible to fast access the data, but it is put
> > into Matlab as characters without delimiter. For example, if one type
> >
> > urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lang=SE&fn=ABB&outputmode=5&format=csv&separator=,&lcid=2057&stockid=77151');
> >
> > A 1x87014 long char is created, however, I would like the data to be
> > stored as a Matrix with the format,
> >
> > 91.90 91.90 89.70 90.35 4212226
> > 90.55 91.95 90.10 91.90 4277414
> > etc
> >
> > Do anyone know how to solve that problem?
>
> You could parse the string using various string operations.
>
> But seeing that the data is CSV (comma separated values), you could use
> URLWRITE to to a local CSV file and then use this command to obtain the
> data as a matrix:
> d=xlsread('d.csv') (on a windows machine)

But is it possible to write to a local file with urlwrite? I did try it but Matlab complained when I used

s=urlread('http......................

urlwrite(s,'data.csv');

Or should it be written in another way?

Subject: Using urlread to download data from the web

From: Magnus Andersson

Date: 11 Nov, 2009 19:30:08

Message: 4 of 7

"Magnus Andersson" <magnusandersson75@gmail.com> wrote in message <hdf2ss$srs$1@fred.mathworks.com>...
> "Ashish Uthama" <first.last@mathworks.com> wrote in message <op.u28ul5gwa5ziv5@uthamaa.dhcp.mathworks.com>...
> > On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson
> > <magnusandersson75@gmail.com> wrote:
> >
> > > I would like to directly read financial data from the web and analys it.
> > > By using Urlread its possible to fast access the data, but it is put
> > > into Matlab as characters without delimiter. For example, if one type
> > >
> > > urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lang=SE&fn=ABB&outputmode=5&format=csv&separator=,&lcid=2057&stockid=77151');
> > >
> > > A 1x87014 long char is created, however, I would like the data to be
> > > stored as a Matrix with the format,
> > >
> > > 91.90 91.90 89.70 90.35 4212226
> > > 90.55 91.95 90.10 91.90 4277414
> > > etc
> > >
> > > Do anyone know how to solve that problem?
> >
> > You could parse the string using various string operations.
> >
> > But seeing that the data is CSV (comma separated values), you could use
> > URLWRITE to to a local CSV file and then use this command to obtain the
> > data as a matrix:
> > d=xlsread('d.csv') (on a windows machine)
>
> But is it possible to write to a local file with urlwrite? I did try it but Matlab complained when I used
>
> s=urlread('http......................
>
> urlwrite(s,'data.csv');
>
> Or should it be written in another way?

It works! Thanks for guiding me in the right direction Ashish!

I used
urwrite('http.........',data.csv');
data = csvread('data.csv');

Thanks!

Subject: Using urlread to download data from the web

From: jonny

Date: 17 Nov, 2009 02:44:30

Message: 5 of 7

On Nov 11, 2:30 pm, "Magnus Andersson" <magnusandersso...@gmail.com>
wrote:
> "Magnus Andersson" <magnusandersso...@gmail.com> wrote in message <hdf2ss$sr...@fred.mathworks.com>...
> > "Ashish Uthama" <first.l...@mathworks.com> wrote in message <op.u28ul5gwa5z...@uthamaa.dhcp.mathworks.com>...
> > > On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson  
> > > <magnusandersso...@gmail.com> wrote:
>
> > > > I would like to directly readfinancialdata from the web and analys it.  
> > > > By using Urlread its possible to fast access the data, but it is put  
> > > > into Matlab as characters without delimiter. For example, if one type
>
> > > > urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lan...
>
> > > > A 1x87014 long char is created, however, I would like the data to be  
> > > > stored as a Matrix with the format,
>
> > > > 91.90    91.90   89.70   90.35   4212226
> > > > 90.55    91.95   90.10   91.90   4277414
> > > > etc
>
> > > > Do anyone know how to solve that problem?
>
> > > You could parse the string using various string operations.
>
> > > But seeing that the data is CSV (comma separated values), you could use  
> > > URLWRITE to to a local CSV file and then use this command to obtain the  
> > > data as a matrix:
> > > d=xlsread('d.csv') (on a windows machine)
>
> > But is it possible to write to a local file with urlwrite? I did try it but Matlab complained when I used
>
> > s=urlread('http......................
>
> > urlwrite(s,'data.csv');
>
> > Or should it be written in another way?
>
> It works! Thanks for guiding me in the right direction Ashish!
>
> I used
> urwrite('http.........',data.csv');
> data = csvread('data.csv');
>
> Thanks!

You may be interested in this:
http://www.offbeatanalytics.com/

Subject: Using urlread to download data from the web

From: Magnus Andersson

Date: 17 Nov, 2009 08:27:03

Message: 6 of 7

jonny <jonnazemi@gmail.com> wrote in message <c7322adc-d604-4215-a33a-ab4d93bd8610@e31g2000vbm.googlegroups.com>...
> On Nov 11, 2:30?pm, "Magnus Andersson" <magnusandersso...@gmail.com>
> wrote:
> > "Magnus Andersson" <magnusandersso...@gmail.com> wrote in message <hdf2ss$sr...@fred.mathworks.com>...
> > > "Ashish Uthama" <first.l...@mathworks.com> wrote in message <op.u28ul5gwa5z...@uthamaa.dhcp.mathworks.com>...
> > > > On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson ?
> > > > <magnusandersso...@gmail.com> wrote:
> >
> > > > > I would like to directly readfinancialdata from the web and analys it. ?
> > > > > By using Urlread its possible to fast access the data, but it is put ?
> > > > > into Matlab as characters without delimiter. For example, if one type
> >
> > > > > urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lan...
> >
> > > > > A 1x87014 long char is created, however, I would like the data to be ?
> > > > > stored as a Matrix with the format,
> >
> > > > > 91.90 ? ?91.90 ? 89.70 ? 90.35 ? 4212226
> > > > > 90.55 ? ?91.95 ? 90.10 ? 91.90 ? 4277414
> > > > > etc
> >
> > > > > Do anyone know how to solve that problem?
> >
> > > > You could parse the string using various string operations.
> >
> > > > But seeing that the data is CSV (comma separated values), you could use ?
> > > > URLWRITE to to a local CSV file and then use this command to obtain the ?
> > > > data as a matrix:
> > > > d=xlsread('d.csv') (on a windows machine)
> >
> > > But is it possible to write to a local file with urlwrite? I did try it but Matlab complained when I used
> >
> > > s=urlread('http......................
> >
> > > urlwrite(s,'data.csv');
> >
> > > Or should it be written in another way?
> >
> > It works! Thanks for guiding me in the right direction Ashish!
> >
> > I used
> > urwrite('http.........',data.csv');
> > data = csvread('data.csv');
> >
> > Thanks!
>
> You may be interested in this:
> http://www.offbeatanalytics.com/

The price for the toolbox is 125 $, one can buy a Technical Analysis stand alone program with the same functions cheaper than that. Also, I have the Financial Toolbox that contains most of these functions.

By the way, the title is misspelled at www.offbeatanalytics.com. It reads Techncial Analysis Toolbox.

Subject: Using urlread to download data from the web

From: jonny

Date: 17 Nov, 2009 17:12:32

Message: 7 of 7

On Nov 17, 3:27 am, "Magnus Andersson" <magnusandersso...@gmail.com>
wrote:
> jonny <jonnaz...@gmail.com> wrote in message <c7322adc-d604-4215-a33a-ab4d93bd8...@e31g2000vbm.googlegroups.com>...
> > On Nov 11, 2:30?pm, "Magnus Andersson" <magnusandersso...@gmail.com>
> > wrote:
> > > "Magnus Andersson" <magnusandersso...@gmail.com> wrote in message <hdf2ss$sr...@fred.mathworks.com>...
> > > > "Ashish Uthama" <first.l...@mathworks.com> wrote in message <op.u28ul5gwa5z...@uthamaa.dhcp.mathworks.com>...
> > > > > On Wed, 11 Nov 2009 10:27:01 -0500, Magnus Andersson ?
> > > > > <magnusandersso...@gmail.com> wrote:
>
> > > > > > I would like to directly readfinancialdata from the web and analys it. ?
> > > > > > By using Urlread its possible to fast access the data, but it is put ?
> > > > > > into Matlab as characters without delimiter. For example, if one type
>
> > > > > > urlread('http://www.euroinvestor.se/HistoricalQuotes/HistoricalQuotes.aspx?lan...
>
> > > > > > A 1x87014 long char is created, however, I would like the data to be ?
> > > > > > stored as a Matrix with the format,
>
> > > > > > 91.90 ? ?91.90 ? 89.70 ? 90.35 ? 4212226
> > > > > > 90.55 ? ?91.95 ? 90.10 ? 91.90 ? 4277414
> > > > > > etc
>
> > > > > > Do anyone know how to solve that problem?
>
> > > > > You could parse the string using various string operations.
>
> > > > > But seeing that the data is CSV (comma separated values), you could use ?
> > > > > URLWRITE to to a local CSV file and then use this command to obtain the ?
> > > > > data as a matrix:
> > > > > d=xlsread('d.csv') (on a windows machine)
>
> > > > But is it possible to write to a local file with urlwrite? I did try it but Matlab complained when I used
>
> > > > s=urlread('http......................
>
> > > > urlwrite(s,'data.csv');
>
> > > > Or should it be written in another way?
>
> > > It works! Thanks for guiding me in the right direction Ashish!
>
> > > I used
> > > urwrite('http.........',data.csv');
> > > data = csvread('data.csv');
>
> > > Thanks!
>
> > You may be interested in this:
> >http://www.offbeatanalytics.com/
>
> The price for the toolbox is 125 $, one can buy aTechnicalAnalysisstand alone program with the same functions cheaper than that. Also, I have the Financial Toolbox that contains most of these functions.
>
> By the way, the title is misspelled atwww.offbeatanalytics.com. It reads TechncialAnalysisToolbox.

you paid $1500 for that toolbox? I think it's way overpriced. This
thing saved me lots of time. I didn't want a stand-alone application I
just wanted to do technical analysis in matlab.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
financial Magnus Andersson 11 Nov, 2009 10:29:10
urlread Magnus Andersson 11 Nov, 2009 10:29:10
web Magnus Andersson 11 Nov, 2009 10:29:10
rssFeed for this Thread

Contact us at files@mathworks.com