Is there any version of grep that gets information from the filename?

For example:
x <- "myfile.txt"
y <- grep.file("my text", x)
should return in y the lines with my text.

I know that
x <- "myfile.txt"
y <- grep("my text", readLines(x))
will probably work, but maybe there's a more direct (and
less memory hungry) option.

Alberto Monteiro

______________________________________________
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.

Reply via email to