[R] Parsing Files in R (USGS StreamFlow data)

stephen sefick ssefick at gmail.com
Mon Oct 5 03:49:54 CEST 2009


http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269

I would like to be able to parse this file up:

I can do this
x <- read.table("http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269",
skip=26)

but If I add another gauge to this

x <- read.table("http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269,06018500",
skip=26)
It does not work because there are two files appended to each other.

It would be easy enough to write the code so that each individual
gauge would be read in as a different file, but is there a way to get
this information in using the commented part of the file to give the
headers?  This is probably a job for some other programing language
like perl, but I don't know perl.

any help would be very helpful.
regards,

-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis




More information about the R-help mailing list