From: Roger Pack Date: 2010-07-02T04:33:02+09:00 Subject: Re: Fast searching of large files Stuart Clarke wrote: > Hey all, > > Could anyone advise me on a fast way to search a single, but very large > file (1Gb) quickly for a string of text? Also, is there a library to > identify the file offset this string was found within the file? a fast way is to do it in C :) Here are a few other helpers, though: 1.9 has faster regexes boost regexes: http://github.com/michaeledgar/ruby-boost-regex (you could probably optimize it more than it currently is, as well...) Rubinius also might help. Also make sure to open your file in binary mode if you're on 1.9. That reads much faster. If that's an option, anyway. GL. -rp -- Posted via http://www.ruby-forum.com/.