I'm processing a very large file into a hash and would like to have a status
message telling me how far along it is (i.e. 30% processed...). What I
would like to do is:
1) find out how many times a keyword is found in this file (since this is a
big file I don't want to have to iterate twice, once for total keywords and
once for storing the records associated with them), or
2) query the filehandle to tell me where I am at with respect to the total
file size.
As long as your file read routine is written to take a hash, then you
should have no problem. I recommend using progressbar.rb on RAA to
make your progress bar, though.
Note: I'm pretty sure that 0.8.0 isn't the ideal version, because I
think it added some Windows incompatibilities; I need to check and
send a patch to the maintainter.
-austin
···
On Mon, 30 Aug 2004 03:55:28 +0900, JG <perfyct@yahoo.com> wrote:
Hopefully this is an easy one...
I'm processing a very large file into a hash and would like to have a status
message telling me how far along it is (i.e. 30% processed...). What I
would like to do is:
1) find out how many times a keyword is found in this file (since this is a
big file I don't want to have to iterate twice, once for total keywords and
once for storing the records associated with them), or
2) query the filehandle to tell me where I am at with respect to the total
file size.
As long as your file read routine is written to take a hash, then you
should have no problem. I recommend using progressbar.rb on RAA to
make your progress bar, though.
Note: I'm pretty sure that 0.8.0 isn't the ideal version, because I
think it added some Windows incompatibilities; I need to check and
send a patch to the maintainter.
I had a little more luck with libpbar-ruby (also on RAA). They both are
fairly similar, but sometimes progressbar.rb would crash with stack
level too deep error. I didn't have time to debug it, though.