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.


In reply to Re^2: How to get fast random access to a large file? by gothic_mallard
in thread How to get fast random access to a large file? by gothic_mallard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.