Re: [R] Search and extract string function

2010-07-15 Thread Marc Schwartz
On Jul 15, 2010, at 11:27 AM, AndrewPage wrote: > > Actually I have one more question that's somewhat related-- I'm starting out > by importing a .txt file that isn't divided into vectors and is at times > inconsistent with regards to spacing, indents, etc., so I can't rely on > those. It looks

Re: [R] Search and extract string function

2010-07-15 Thread AndrewPage
Actually I have one more question that's somewhat related-- I'm starting out by importing a .txt file that isn't divided into vectors and is at times inconsistent with regards to spacing, indents, etc., so I can't rely on those. It looks something like this: "Drink=Coffee:Location=Office:Time=M

Re: [R] Search and extract string function

2010-07-15 Thread AndrewPage
Thanks! That's much less complicated and does everything I wanted it to do. -- View this message in context: http://r.789695.n4.nabble.com/Search-and-extract-string-function-tp2290268p2290356.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Search and extract string function

2010-07-15 Thread Gabor Grothendieck
On Thu, Jul 15, 2010 at 10:48 AM, AndrewPage wrote: > > Hi all, > > I'm trying to write a function that will search and extract from a long > character string, but with a twist: I want to use the characters before and > the characters after what I want to extract as reference points.  For > exampl

Re: [R] Search and extract string function

2010-07-15 Thread Marc Schwartz
On Jul 15, 2010, at 9:48 AM, AndrewPage wrote: > > Hi all, > > I'm trying to write a function that will search and extract from a long > character string, but with a twist: I want to use the characters before and > the characters after what I want to extract as reference points. For > example,

[R] Search and extract string function

2010-07-15 Thread AndrewPage
Hi all, I'm trying to write a function that will search and extract from a long character string, but with a twist: I want to use the characters before and the characters after what I want to extract as reference points. For example, say I'm working with data entries that looks like this: Drink