himanshuyadav has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: correlation between two inputt files
by choroba (Cardinal) on Apr 27, 2012 at 12:36 UTC
    This is how I would proceed:

    Create a hash. The keys will be the reaction numbers. The values will be hash references with two keys: 'reactants' and 'products'. The values will be hash references again, use reactants and products respectively as keys. The values can stay undefined. After the hashes are filled, just go over the keys and print out all the tuples in nested loops.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: correlation between two inputt files
by jethro (Monsignor) on Apr 27, 2012 at 12:38 UTC

    Just create a HashOfArrays, with reaction number as key and an array of products as data. Fill it with the data from File2.txt. Then read in the File1.txt and for every reactant check the hash for the array of products it can be transformed into.

Re: correlation between two inputt files
by MidLifeXis (Monsignor) on Apr 27, 2012 at 12:53 UTC

    If I am reading your question correctly, you wish to join two files where they have common values in the second column (see join for the unix command line equivalent).

    --MidLifeXis

Re: correlation between two inputt files
by Anonymous Monk on Apr 27, 2012 at 12:40 UTC