in reply to Search a text in a file

I don't know how fast you want it but on my system with a 14 meg file I can do a trivial pattern match over the entire file in 1.2 seconds.
$ time perl -e 'while (<>){$c++ if ($_=~/compaq/i)};print $c' *t 454 real 1.2 user 1.0 sys 0.1
Can you be more specific?

Sweetblood

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.