From: "Peña, Botp" Date: 2008-09-05T14:27:05+09:00 Subject: Re: How do I quickly search the end of a huge text file? From: Brian Green [mailto:gallagherjb@gmail.com] # It's slow because the script is going to integrated into the # companies # online asset management software - and I was told by the IT # guys that if # it's slower than a certain speed it will time out - it # currently is too slow. # # As far as how many files it ranges between 3-5 (usually), the # sizes of # the files vary from about 5MB-50MB max of 5 * 50MB not so bad if you have lots of ram # Disk space is not an issue - there's tons of it. As far memory goes - # the IT guys said it can't load the whole file into memory. # CPU is fairly fast - but again this isn't the problem - since # it will be running from a server... # # > # > # I know that all the information I need is # > # in the last 5% of the text file - but I haven't been able to # > # > are you sure of the 5% ? # > where is your proof? # # I've gone through many files and manually located where the text I'm # looking for appears - they appear no further out that 5% from # the end... ok no problem. we can adjust it anytime ;) # > # figure out a way to either jump to near the end, and then # > # start search through lines # > # > low level, use IO:SEEK_END # # I'm not sure how to use the SEEK_END properly and it's hard # finding good examples... the examples are clear enough. try it first for one file. then post your tried codes again here. kind regards -botp