Sign in to follow this  
Followers 0
Kickassjoe

File System, Array, or Something Else?!?

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi! Works with large text file used arrays not a good idea. See aside sed, gsar, egrep utilites.

Edited by rasim

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0