Skip to content
Prev 198963 / 398506 Next

Scanning grep through huge files

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