Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8791 > unrolled thread

Re: adding a string to a list of number in the importing loop from a Web

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-02-29 12:27 +0000
Last post2012-02-29 12:27 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: adding a string to a list of number in the importing loop from a Web Bob Hanlon <hanlonr357@gmail.com> - 2012-02-29 12:27 +0000

#8791 — Re: adding a string to a list of number in the importing loop from a Web

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-02-29 12:27 +0000
SubjectRe: adding a string to a list of number in the importing loop from a Web
Message-ID<jil5ke$rrb$1@smc.vnet.net>
I recommend that you go to the virtual book and read the sections on
strings.


data4 = {{"050318", "111529"}, {"050401", "113120"}};


Do[ID = data4[[i, 2]];
 s = Import["http://www.swift.ac.uk/xrt_curves/" <> "00" <> ID, "Text"];
 Print[s], {i, 1, Length[data4]}]



Bob Hanlon

On Mon, Feb 27, 2012 at 9:00 PM, maria giovanna dainotti <
mariagiovannadainotti@yahoo.it> wrote:

> Dear All,
> thanks for the previous suggestions all of them worked.
>
> I have  a long list of elements (I just took two as example)
> data4 = {{"050318", "111529"}, {"050401", "113120"}} and I would like to
> add in the second element 00
> When I try
> Do[
>  ID = data4[[i, 2]];
>  s = Import["http://www.swift.ac.uk/xrt_curves/" <> 00 ID, "Text"];
>  Print[s],
>  {i, 1, Length[data4]}]
> This does,'t work
> As well as the following:
> Do[
>  ID = data4[[i, 2]];
>  s = Import["http://www.swift.ac.uk/xrt_curves/" <> "00" ID, "Text"];
>  Print[s],
>  {i, 1, Length[data4]}]
>
> As well as this again
> Do[
>  ID = data4[[i, 2]];
>  s = Import["http://www.swift.ac.uk/xrt_curves/" <> "00ID", "Text"];
>  Print[s],
>  {i, 1, Length[data4]}]
>
> Is it a problem of the position of " " or something else?
>
> Thanks a lot,
> regards,
> Maria
>
> --- *Sab 25/2/12, Hans Michel <hmichel@cox.net>* ha scritto:
>
>
> Da: Hans Michel <hmichel@cox.net>
> Oggetto: RE: Importing data from the web
> A: "'maria giovanna dainotti'" <mariagiovannadainotti@yahoo.it>,
> mathgroup@smc.vnet.net
> Data: Sabato 25 febbraio 2012, 16:52
>
>
> Maria:
>
> Try
>
> data4 = {{"050318", "00111529"}, {"050401", "00113120"}};
> Do[
> ID = data4[[i, 2]];
> url = "http://www.swift.ac.uk/xrt_curves/" <> ID ;
> s = Import[url, "Text"];
> Print[s],
> {i, 1, Length[data4]}
> ]
>
> The string join you were attempting did not work. I moved the concatenation
> of the url string external to the Import this way if you wish to test if
> the
> url exist before import you can. Somewhere on MathGroup there is code to
> test for existence of a URL.
>
> Hans
>
> -----Original Message-----
> From: maria giovanna dainotti [mailto:mariagiovannadainotti@yahoo.it]
> Sent: Saturday, February 25, 2012 12:55 AM
> To: mathgroup@smc.vnet.net
> Subject: Importing data from the web
>
>
> Dear Math Group,
>
> I have a problem importing the data from a web page.
>
> data4 = {{"050318", "00111529"}, {"050401", "00113120"}}
> Do[
> ID = data4[[i, 2]];
> s = Import["http://www.swift.ac.uk/xrt_curves/<>ID<>", "Text"];
> Print[s],
> {i, 1, Length[data4]}]
>
> The error message is
> $Failed
>
> I am really grateful if you could help me
>
> Best regards,
> Maria
>
>
>
>


-- 
Bob Hanlon

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web