in reply to 2 Hash Tables, 4 Keys...what to do?

Well yes, but what are the chances the files are sorted? You could also assume they aren't sorted, make a pass through both to find out which lines match between the two, pass through one again to retrieve just those lines, and pass through the other to match. This would only require storing lines with a key match in memory instead of an entire file.
  • Comment on Re: 2 Hash Tables, 4 Keys...what to do?

Replies are listed 'Best First'.
Re^2: 2 Hash Tables, 4 Keys...what to do?
by ikegami (Patriarch) on Jun 03, 2005 at 17:53 UTC
    Well yes, but what are the chances the files are sorted?

    100% if the the application that produced them produces sorted files.

    And if it doesn't, you could use an speed- and memory-efficient program (possibly written in C) to do the sorting beforehand.