Re: [R] split character vector by multiple keywords simultaneously

2011-05-08 Thread sunny
Andrew Robinson-6 wrote: > > A hack would be to use gsub() to prepend e.g. XXX to the keywords that > you want, perform a strsplit() to break the lines into component > strings, and then substr() to extract the pieces that you want from > those strings. > > Cheers > > Andrew > Thanks, that go

Re: [R] split character vector by multiple keywords simultaneously

2011-05-06 Thread Greg Snow
-project.org] On Behalf Of sunny Sent: Wednesday, May 04, 2011 5:09 PM To: r-help@r-project.org Subject: [R] split character vector by multiple keywords simultaneously Hi. I have a character vector that looks like this: > temp <- c("Company name: The first company General Manager:

Re: [R] split character vector by multiple keywords simultaneously

2011-05-04 Thread Andrew Robinson
A hack would be to use gsub() to prepend e.g. XXX to the keywords that you want, perform a strsplit() to break the lines into component strings, and then substr() to extract the pieces that you want from those strings. Cheers Andrew On Wed, May 04, 2011 at 04:08:40PM -0700, sunny wrote: > Hi. I

[R] split character vector by multiple keywords simultaneously

2011-05-04 Thread sunny
Hi. I have a character vector that looks like this: > temp <- c("Company name: The first company General Manager: John Doe I > Managers: John Doe II, John Doe III","Company name: The second company > General Manager: Jane Doe I","Company name: The third company Managers: > Jane Doe II, Jane Doe II