Jump to content

File System, Array, or Something Else?!?


Recommended Posts

I am currently faced with the problem of speed. I need to sort through a 3743 line text file every 3 seconds or so... but when a piece of information being searched for is at the end of the text file, it often takes more than 10 seconds, sometimes almost 20. Should I put the text file into an array when I load the script, would that make it any faster? Or is there another way that I could make searching through a large text file faster?

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

I am currently faced with the problem of speed. I need to sort through a 3743 line text file every 3 seconds or so... but when a piece of information being searched for is at the end of the text file, it often takes more than 10 seconds, sometimes almost 20. Should I put the text file into an array when I load the script, would that make it any faster? Or is there another way that I could make searching through a large text file faster?

Hi,

if you know it is at the end, load, say the last 10 or 100 linnes or whatever only; use "TailRW" link from my signature;

if it can be anywhere in the file, , then you are stuck..

Best, randall

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...