Dear Monks.
I'm stuck with a problem and I tried all the possibilities I had in mind. Now I hope someone can give me a hands.
Basically my problem is:
I have a tab delimited text file 1 with 5 different fields. From this file I need the field five associated to the field 1.
Now I have a tab delimited text file 2. Here I have 15 fields and I want to add the info of field 5 from file 1, if the field 11 (of file 2) is equal to the field 1 of file 1. More I just want to add the infos, not to obtain a new file with only the lines with all the info in it.
What I have done is to obtain an hash from file 1. Then when going to file 2 I compare the field 11 with all the keys of the hash and if I find the correspondence I print on a new file the line together with the value of the hash. In this way I get only a new out file with only the lines where I have added the new field, but still I want all of them
Anyone has any idea about what I'm doing wrong?
Guess my problem comes with this code, where I could put an else and print the line $_, but this is printed for all the keys I have in the hash.....too many!