[R] Find String Between Characters

From: Sparks, John James <jspark4_at_uic.edu>
Date: Sat, 14 May 2011 19:20:16 -0500


Dear R Helpers,

I am trying to isolate a set of characters between two other characters in a long string file. I tried some of the examples on the R help pages and elsewhere, but I am not able to get it. Your help would be much appreciated.

require(scrapeR)
mmm<-scrape(url="http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0000320193&owner=exclude&count=40") str(mmm)

I want to get the number 0000320193 that is between the CIK= and the &. I have tried

g <- grep( "CIK=|&", mmm )
and
temp<-grep(mmm,\CIK=\&)

and variations on these themes, but all won't run or come bask as an empty object. How can I grab this number?

Best wishes,
--John J. Sparks, Ph.D.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 15 May 2011 - 00:24:48 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 15 May 2011 - 13:00:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive