Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: (tye)Re: get the line of ith occurrence of '>' without OPENING THE FILE

by clintp (Curate)
on Oct 05, 2002 at 23:13 UTC ( #203103=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: get the line of ith occurrence of '>' without OPENING THE FILE
in thread get the line of ith occurrence of '>' without OPENING THE FILE

If we're going as far as having access to "cat" and "shell", then it might be fun to tinker with "dd" as well. Then the OP can get to just the part of the file he wants to:
open(THIRDMB, "dd if=$filename bs=1024 skip=2048 count=1024|") or die; while(<>) { ... } # Reads third MB of file only. close(THIRDMB);
dd's useful in Unix for skipping around in large files at the shell level where seek(2) might be a bit more complicated.
  • Comment on Re: (tye)Re: get the line of ith occurrence of '>' without OPENING THE FILE
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://203103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2023-03-27 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?