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


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

Re: Importing data from the web

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-02-26 09:22 +0000
Last post2012-02-26 09:22 +0000
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Importing data from the web Bob Hanlon <hanlonr357@gmail.com> - 2012-02-26 09:22 +0000

#8746 — Re: Importing data from the web

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-02-26 09:22 +0000
SubjectRe: Importing data from the web
Message-ID<jictl4$ena$1@smc.vnet.net>
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]}]

However, you might find Table more useful than Do

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

All of the data is then stored in s1

Alternatively, without Table or Do

s2 = Import["http://www.swift.ac.uk/xrt_curves/" <> Last[#], "Text"] & /@
   data4;

s1 == s2

True

Bob Hanlon


On Sat, Feb 25, 2012 at 1:55 AM, maria giovanna dainotti
<mariagiovannadainotti@yahoo.it> wrote:
>
> 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

[toc] | [standalone]


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


csiph-web