On Fri, Feb 5, 2010 at 9:29 AM, jim holtman <jholt...@gmail.com> wrote: > Does this help: > >> x <- >> c("1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12") >> y <- strsplit(x, '[.]')
Here's another way with the stringr package: library(stringr) x <- c("1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12","1234567.z3.abcdef-gh.12") y <- str_split_fixed(x, '[.]', 4) y[, 1] y[, 2] Hadley -- 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.