Dear all, how can i search multiple text or string patterns in a text file. i have written the following script but it is for only single searches at a time. how can i get multiple searches e.g "xyz","abc","pqr".....at a time and can save the results to an out file.
script:: x<- "abc" z<-NULL;for (i in 1:1235){{if (as.integer(regexpr(pattern=x,as.character(abstracts_abc[i,2]), ignore.case=TRUE)) != 1) z<- c(z, i) }} temp<- z[1]; testfile<- abstracts_abc[temp,] for (i in 2:250){temp<- z[i]; testfile<- rbind(testfile,abstracts_abc[temp,])} Kind regards Ab Rauf Shah [[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.