Skip to content
Prev 309510 / 398506 Next

grep txt file names from html

On Oct 31, 2012, at 9:56 AM, chuck.01 wrote:

            
This shows code that will identify lines in that source page containing URLs that end in '.txt"'
Warning message:
In readLines(con = url("http://www.epa.gov/emap/remap/html/three/data/index.html")) :
  incomplete final line found on 'http://www.epa.gov/emap/remap/html/three/data/index.html'
# You can generally ignore that warning.
[1] 11

Should be fairly straightforward to remove the preceding and trailing material.
[1] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/benthic/benmet.txt"  
 [2] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/benthic/bencnt.txt"  
 [3] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/location/watchr.txt" 
 [4] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/location/habbest.txt"
 [5] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/design/sdesign.txt"  
 [6] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/wchem/chmval.txt"    
 [7] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/fish/fshmet.txt"     
 [8] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/fish/fshcnt.txt"     
 [9] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/fish/fshnam.txt"     
[10] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/tissue/ftmet.txt"    
[11] "http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/tissue/ftorg.txt"
David Winsemius, MD
Alameda, CA, USA