> Hi there,
> I have a large/huge text file. I need to locate a line in the file with a
> specific string, for example, "Data Points". Now, I use the following code
> to do:
> df <- readLines(file)
> l <- grep("Data Points", df)
> However, in this case, the file will be read throughout into R. When the
> file is huge, it will cost much memory and time.
> Is there any more elegant way to do that? Thanks.
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posti > ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.