[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with reading file and executing other stuffs?

From: Horinius
Subject: Re: Problem with reading file and executing other stuffs?
Date: Thu, 8 Nov 2007 08:56:36 -0800 (PST)

Hugh Sasse wrote:
> And vi warns about it in a similar way to ed.
> Again, what problem are you trying to solve, if any?  
I'm doing some processing in a big file which is well formatted.  It's sort
of a database table (or a CVS file if you like).  Every line contains a
unique element that determines what should be done.  Of course, I could go a
grep on the file to find out the elements, but this would give a complexity
of O(n^2).

I know that every line is processed only once, and the pointer to the
current line will never go back.  So I figure out that I could read every
line in an array element and I could process line by line.  This would give
a O(n) which is much faster.

View this message in context: 
Sent from the Gnu - Bash mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]