How to quickly search over a large number of files using python?

dwivedi.devika at gmail.com dwivedi.devika at gmail.com
Wed Sep 25 04:41:38 EDT 2013


Hi all,

I am a newbie to python.

I have about 500 search queries, and about 52000 files in which I have to find all matches for each of the 500 queries.

How should I approach this? Seems like the straightforward way to do it would be to loop through each of the files and go line by line comparing all the terms to the query, but this seems like it would take too long.

Can someone give me a suggestion as to how to minimize the search time?

Thanks!



More information about the Python-list mailing list