On Wed, Apr 13, 2011 at 5:18 AM, Dennis Murphy <djmu...@gmail.com> wrote: > Hi: > > Here's one approach: > > strings <- c( > "A5.Brands.bought...Dulux", > "A5.Brands.bought...Haymes", > "A5.Brands.bought...Solver", > "A5.Brands.bought...Taubmans.or.Bristol", > "A5.Brands.bought...Wattyl", > "A5.Brands.bought...Other") > > slist <- strsplit(strings, '\\.\\.\\.')
Or with stringr: library(stringr) str_split_fixed(strings, fixed("..."), n = 2) # or maybe str_match(strings, "(..).*\\.\\.\\.(.*)") Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ ______________________________________________ R-help@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.