Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: How to get fast random access to a large file?

by gothic_mallard (Pilgrim)
on Oct 29, 2004 at 12:53 UTC ( [id://403729]=note: print w/replies, xml ) Need Help??


in reply to Re: How to get fast random access to a large file?
in thread How to get fast random access to a large file?

As I replied to fglock I can't change the files structure, only it's data. i.e. I can add/remove/change lines but I have no control over "how" they're represented.

Each line is a fixed length record in itself, but each record type has a different structure. Say, a "print here" may be:

x pos (6 char) y pos (6 char) string (300 char)

and a "new sheet" may be

sheet number (4 char) stock code (10 char)

and so on (those aren't real structures above but similar to the real thing).

I was toying with the idea of creating index files, but that comes with the overhead of having to parse the original file first to create them (if I could do that quickly it wouldn't be so much of a problem ;-)).

--- Jay

All code is untested unless otherwise stated.
All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
If in doubt ask.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-03-29 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found