efficient text file search.

noro amit.man at gmail.com
Mon Sep 11 07:42:17 EDT 2006


:)

via python...

Luuk wrote:
> "noro" <amit.man at gmail.com> schreef in bericht
> news:1157973527.817462.207420 at h48g2000cwc.googlegroups.com...
> > Is there a more efficient method to find a string in a text file then:
> >
> > f=file('somefile')
> > for line in f:
> >    if 'string' in line:
> >         print 'FOUND'
> >
>
>
> yes, more efficient would be:
> grep (http://www.gnu.org/software/grep/)




More information about the Python-list mailing list