in reply to Offset Reading - two files

Let's see a little history:

  1. In 2008, you asked; I replied.
  2. Two and a half years later you re-posted my code and asked.
  3. And now nearly two years on, you do the same again.

You haven't explained what you are trying to do; shown examples of the files in question; or explained why it should be a one-liner.

You seem to have unlimited time to solve the problem; but also seem to have made no progress in the intervening 5 years.

What are you actually trying to solve?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

Replies are listed 'Best First'.
Re^2: Offset Reading - two files
by gio001 (Acolyte) on Dec 14, 2012 at 14:39 UTC
    OK, yes I understand your valid points. Here is a little history: when I originally asked you the question I was facing a problem on retrieving data from a large file whose record structure information was stored in an index file. At that time the structure of the index file was sequential that is the next record was always starting right after the end of the prior record, so no offset was actually involved. The code you supplied was perfectly doing the retrieval by sequentially picking up chunks from the big file. Now the structure of the big file has been changed by the vendor and there is extraneous data in between each record for which I have to make use of the offset information each time before I can get the record I am interested in. I understand your surprise and the disappointment for my ignorance, I can only say I wish I had more time to dedicate to the discovery of Perl abilities ..... Thanks for all you did
      Now the structure of the big file has been changed by the vendor and there is extraneous data in between each record for which I have to make use of the offset information each time before I can get the record I am interested in.... I wish I had more time to dedicate to the discovery of Perl abilities

      That change appears to have happened 20 months ago. How have you been handling the problem in the interim?

      Have you heard of seek?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

        Hello, I have tried this, with no success:

        perl -sple"BEGIN{open BIG};($1,$2)=split;seek(BIG,$1,$2);read(BIG,$_,$2)" -- -BIG=bigfile.dat index.dat >outfile.dat

        What I asked '20 months' ago was not related to the change that occurred recently. Thanks
        Hello, I know I should not be wasting your time, sorry. Goodbye