thanks for reply..I got it...:) On Thu, Jun 14, 2012 at 8:41 PM, Rui Barradas [via R] < ml-node+s789695n4633393...@n4.nabble.com> wrote:
> Hello, > > I don't understand, do you want to output: > > 1st line: the original input line > 2nd line: " I want output in following format " <-- this line > > 3rd line and following: the input line broken by the patterns > > Then just > > > f <- function(x, pattern) unlist(strsplit(x, pattern)) > > x <- "I love to watch movies of Hollywood but should not be romantic...I > want to > join you school but due to bad financial condition I cant.. " > > x <- gsub("[[:space:]]+", " ", x) > pat <- c("but", "\\.\\.+") > > out <- Reduce(f, c(x, pat)) > out <- c("1st line", "2nd line", out) > > Rui Barradas > > Em 14-06-2012 08:36, raishilpa escreveu: > > > hello > > Can you help me further > > Is this possible to get output in the following way- > > > > [1 " ]I love to watch movies of Hollywood but should not be > romantic...I > > want to > > join you school but due to bad financial condition I cant.. " > > > > [2] " I want output in following format " > > [3] " I love to watch movies of Hollywood " > > [4] " should not be romantic " > > [5] "I want to join you school' > > [6] " due to bad financial condition I cant " > > > > > > > > > > On Wed, Jun 13, 2012 at 11:57 PM, shilpa rai <[hidden > > email]<http://user/SendEmail.jtp?type=node&node=4633393&i=0>>wrote: > > > > >> thanks a lot !!! > > > > > > > > > > ______________________________________________ > [hidden email] <http://user/SendEmail.jtp?type=node&node=4633393&i=1>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. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://r.789695.n4.nabble.com/separate-the-sentence-after-finding-a-particular-word-tp4633240p4633393.html > To unsubscribe from separate the sentence after finding a particular > word, click > here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4633240&code=cmFpc2hpbHBhLmJodUBnbWFpbC5jb218NDYzMzI0MHwxOTAyOTIzNTU5> > . > NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- Shilpa Rai MSc.(2011-2013) Applied Statistics and Informatics Indian Institute of Technology,Bombay -- View this message in context: http://r.789695.n4.nabble.com/separate-the-sentence-after-finding-a-particular-word-tp4633240p4633401.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ 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.