Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: opening a b...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 10966 of 11065
Post > Topic >>

Re: opening a big file

by shawnhcorey@[EMAIL PROTECTED] (Mr. Shawn H. Corey) Apr 20, 2008 at 05:55 PM

On Sun, 2008-04-20 at 17:02 -0400, Richard Lee wrote:
> Chas. Owens wrote:
> > On Sun, Apr 20, 2008 at 1:49 PM, Richard Lee <rich.japh@[EMAIL PROTECTED]
>
wrote:
> > snip
> >   
> >>  can this be optimized in anyway?
> >>  open (my $source, '-|', "tail -100000 /server/server.log")
> >>
> >>  is this the best way to get large portion(well file itself is over
20
> >> times) of the file into find handle?
> >>     
> > snip
> >
> > Depending on how you are processing data, you may find
> > File::ReadBackwards* useful.
> >
> > * http://search.cpan.org/dist/File-ReadBackwards/ReadBackwards.pm
> >
> >   
> This looks very useful.
> 
> Unfortunately however, the system I am on, I cannot install any modules 
> other than standard modules that already come with the perl.
> But I will try this at my own system.
> 
> thanks!
> 

Sadly, even ReadBackwards in no magic bullet.  (And BTW, it should be
ReadBackward.)

It still has to go through the entire file and mark the offsets to the
start of every line.

The best way to do this is just to bite the bullet and do it.


-- 
Just my 0.00000002 million dollars worth,
    Shawn

When I was in college, my Karate instructor said,
"The first hundred are easy."
Since then, I discovered he'd lied.
Life's too big to describe in hundreds.




 1 Posts in Topic:
Re: opening a big file
shawnhcorey@[EMAIL PROTEC  2008-04-20 17:55:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:28:39 CDT 2008.