in reply to Merge Columns of Multiple files based on Multiple Common Column

Hi

Whatever the above you use, you need to have a concept. Databases are doing this type of joins with two basic algorithms: sort merge or nested loop.

The nested loop works the following way:

I do not recommend this algorithm because it has an awful performance impact. Actually it is one of two ways to take down a server for a couple of hours or weeks!

The second way to do it is called sort merge:

The above assumes one of both file has only one row per composite key ( your 3 columns). If this is the case you will process both files only once and your files are merged. If you have a so called many to many relation between the keys of your two files, you will have to work down file B several times.

I recommend you start merging the two smallest files first, then you sort the result and add the next file with a new merge.

Eventually search CPAN or the net for sort merge examples or modules.

K

The best medicine against depression is a cold beer!
  • Comment on Re: Merge Columns of Multiple files based on Multiple Common Column