[R] Scanning grep through huge files

Johannes Graumann johannes_graumann at web.de
Tue Nov 3 15:29:00 CET 2009


Hi,

I'm dealing which huge files I would like to index. On a linux system "grep 
-buo <PATTERN> <FILENAME>" hands me the byte offsets for "PATTERN" very 
quickly and I am looking to emulate that speed and ease with native R tools 
- for portability and elegance. "gregexpr" should be able to do that but I 
fail to combine it with "scan" or an equivalent to parse the whole file 
without having to read it all into memory.

I'd be grateful for any hints on how to do this without a "pipe("grep -buo 
<PATTERN> <FILENAME>")".

Thanks, Joh




More information about the R-help mailing list