[18901] in s-news-athena

home help back first fref pref prev next nref lref last post

Re: [S] Reading an ASCII file from a web site

daemon@ATHENA.MIT.EDU (Spyros Vrontos)
Tue Aug 10 07:14:36 1999

Message-Id: <3.0.3.32.19990810140517.00753f9c@stat-athens.aueb.gr>
Date: Tue, 10 Aug 1999 14:05:17 +0300
To: s-news@wubios.wustl.edu
From: Spyros Vrontos <svrontos@stat-athens.stats.aueb.gr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"



Hi!
Many thanks to Bill Dunlap for suggesting the following solution.

>If you have perl 5 on your system you can call its GET function
>to download a web page (storing it in Splus as a character vector
>or storing in you local file system as a file for further processing
>and reading into Splus).
>
>The following function has the full path to perl5's GET function
>so you would have to modify it for your system.
>
>lrlGet <- function(url)
>{
>        unix(paste("/sw/local/perl5/bin/GET", url))
>}
>
>E.g., to get roughly hourly weather data from the last 12 hours
>at Seattle-Tacoma Airport do
>
>> urlGet("http://161.55.224.1/cgi-bin/obs.perl?12+SEA")
> [1] "<HTML><HEAD><TITLE>Recent Surface Observations</TITLE></HEAD><BODY>"
     
> [2] "<H2>Recent Observations for SEA expressed in UTC</H2>"
     
> [3] "You last requested these data at: <FONT COLOR=\"#FF0000\">0809 16:01
UTC</FONT>, or 0809 09:01 PDT.<p>"
> [4] "To convert from UTC to PDT, subtract 7 hours.<p>"
     
> [5] "<PRE>"
     
> [6]
"---------------------------------------------------------------------------
------------------------------"
> [7] "         Type     Ceil Sky                       Dew Wind Wind
         "
> [8] "Date Time     Stn (ft/ Cvr Vis Weather Pres  Tmp Tmp Dir  Spd Gust
Alt  Pcpn  Tx  Tn Pcpn24  Xt Snow Remarks"
> [9] "mmdd  UTC     ID  100)      mi.                F   F      Kts  Kts
in.   in. 6hr 6hr    in.                          "
>[10]
"---------------------------------------------------------------------------
------------------------------"
>[11] "0809 1556 SA   SEA 999 SCT  10        1017.6  65  56 000    5
30.05                                 AO2
||||FEW|SCT|SCT|||016|045|250|||||||"
>[12] "0809 1525 SP   SEA  45 BKN  10                       030    6
30.06                              [63/55]   AO2
||||SCT|BKN||||016|045||||||||"
>...
>
>It would need some more processing by perl (or Splus, awk, or sed) to pull
>out the numbers in it.
>
>----------------------------------------------------------------------------
>Bill Dunlap                                      22461 Mt Vernon-Big Lake Rd
>Data Analysis Products Div. of MathSoft, Inc.    Mount Vernon, WA 98274
>bill@statsci.com                                 360-428-8146
>
>"All statements in this message represent the opinions of the author and do
>not necessarily reflecto read later).t MathSoft policy or position."
>
>


Spyros Vrontos.
Athens University of Economics and Business.

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post