in reply to Re: Re: Simplifying my script...
in thread Simplifying my script...

I think you are. If the file is small enough to keep in memory, keep it in memory.

If it's too big to keep in memory, you should put the data into the database, and mark the appropriate fields as keys. Then the database will know how to skip to exactly the right record much faster than you could do it by reading every record.

Remember, if the file is big, it takes a long time to read - and you're reading it each time you go through that loop.