in reply to How to use multidimensional hashes

which code did you use to obtain this ?

Replies are listed 'Best First'.
Re^2: How to use multidimensional hashes
by Perlseeker_1 (Acolyte) on Jan 31, 2014 at 15:16 UTC

    I have two input files and I need to read each record from the file and need to count the number of A's, B's etc and if it repeated in other file, don't take the count and any help on this please

    FILE_A 01|JAPAN|A| 01|CHINA|B| 01|CHINA|B| 01|MALY|C| 01|EUROPE|D|
    FILE_A 01|JAPAN|A| 01|CHINA|B| 01|MALY|C| <p>output what i am expecting is</p> <code> FILE_NAME A B C D CHECK 1 2 1 1

      if you count/sum only the A B C D ... it is normal to get

      FILE_NAME A B C D

      CHECK 2 3 2 1

      JAPAN A is in FILE_A and FILE_B so 2 times

      CHINA B is in FILE_A (twice) and FILE_B so 3 times

      MALY C is in FILE_A and FILE_B so 2 times

      if you don't want to count/sum after the first time, tou have to test the exists before.

        Hi,

        JAPAN A exists in FILE_A and FILE_B, so the count is 2 but i want JAPAN A to be displayed as 1 because it appears in both files

        Example:

        I want the output as:

        FILE NAME A B C D CHECK 1 2 1 1