in reply to Is this possible

For the record, if you do have enormous amounts of information that you need to, say, “cross-tabulate” in this way, you can accomplish the task for arbitrary amounts of data by:

  1. Dump the data into a temporary flat-file, as tuples like {'Kostas', 'RESULTS_FILE2', 3.1415926}.
  2. Sort the file, using an external disk sort such as the venerable sort command or an equivalent CPAN module. Sort it by two keys: first by the 'Kostas' field and then (i.e. within 'Kostas') by 'RESULTS_FILE2.'
  3. Now process the sorted file. Everything for 'Kostas' will be together. Everything for Kostas' columns will be already-arranged in ascending column order. Anything that's not in the right place does not exist, period. Virtually no memory is required.

Sorting is an “unexpectedly fast” algorithm that, for large amounts of data, consistently beats-the-pants off of any random-access algorithm. When you saw all those tapes spinning back and forth (actually, if you watched very closely, the tapes never changed direction...) that's what the computers were doing. Back before computers existed, that's also how it was done ... with punched cards. The same principles still apply. They still work like nothing else does.