View Single Post
Old 02-24-2005, 04:43 PM  
gezzed
Confirmed User
 
Join Date: Mar 2002
Posts: 317
Any perl people in the house?

I'm trying to develop a script that searches through a simple .txt file and returns all the records matching a search query.

This is the general format of the .txt file

xxx----somecategory----123Mb
yyy----someothercategory----456Mb
zzz----onemorecategory---789Mb

Then, someone specifies a query through my site and I need to check whether any of the records in the .txt file match the query by scanning through the xxx, yyy, zzz parts.

Here's the snag, I have 50,000 entries in the .txt file so a simple foreach loop takes way too long.

Any ideas?
gezzed is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote