in reply to Re: Combined lines from a file into one
in thread Combined lines from a file into one

If the number-of-lines in each file is ... say ... “less than a few tens of millions,” then a reasonable first step might be to shove both files into memory...
My understanding from the original post is that there is only one file, not two.

This makes the algorithm quite different.

And if the lines are sorted by the unique identifier as they appear to be, there is not need to load any file into memory. You only need to maintain a min and a max for each identifier.

  • Comment on Re^2: Combined lines from a file into one