in reply to Re: comparing an ID fom one file to the records in the second file
in thread comparing an ID fom one file to the records in the second file

Thankyou so much for the help poj. Much appreciated. and I understand the logic how to do this type of task i.e., using the hash and storing IDs as keys etc. But there still exists one problem. The code is not comparing the hash key (ID) with $col2 and is not printing the related line :(. I commented out the (print "$col2") and it is printing nothing. I am trying to figure this out in the mean time.

  • Comment on Re^2: comparing an ID fom one file to the records in the second file

Replies are listed 'Best First'.
Re^3: comparing an ID fom one file to the records in the second file
by poj (Abbot) on Dec 02, 2017 at 11:45 UTC

    Check that your ID file does not have hidden spaces, tabs etc. Ensure 'clean' data by adding a regex

    while (<FILEID>){ chomp; s/[\s]//g; $ID{$_}=1 if $_; }
    poj

      Thanksalot poj. It worked. I have to run this script on multiple files now. I will get back to you for further help if needed. Thanksalot again :)