Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
for that I wrote the code like:>1 ##key abcdef ##value >2 hijkl >3 abnikhl..etc
So now I have got keys and values. What I need now is to compare each 'value' of file 1 with each value of file2 and if the values are same, assign the 'key' of file1 to the value of file2. file 2 format is:while(<FILE>) { $d=$_; $read.=$d; my ($key, $val) = split /\n/, $read; $hash{$key}= $val;
abcde hijkl mnop qrst uvwx..etc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read file in a hash and compare the 'values' from file 2
by CountZero (Bishop) on Jul 05, 2011 at 15:13 UTC | |
|
Re: Read file in a hash and compare the 'values' from file 2
by jethro (Monsignor) on Jul 05, 2011 at 15:34 UTC | |
|
Re: Read file in a hash and compare the 'values' from file 2
by Anonymous Monk on Jul 05, 2011 at 12:44 UTC | |
by Anonymous Monk on Jul 05, 2011 at 13:14 UTC | |
by Anonymous Monk on Jul 05, 2011 at 13:44 UTC |