in reply to How to make a array of hashes and search them
Thanks a ton for the help. I wrote as per the pseudo code. it worked but here the problem is for each and every ID its print same values in all four columns. I have no clue why it is happening.so i need more help.
Thanking you in advance.
Regards
Deepak
foreach $file (@files) { open(INP,"$file") or die "Cannot open file :$!\n"; while (<INP>) { chomp; @line = split "\t",$_; if(exists $trans{$line[0]}) { $array[$j] = $line[1]; $trans{$line[0]} = \@array; } } close(INP); $j++; } foreach $key (keys %trans) { print OUT "$key\t"; foreach(@{$trans{$key}}) { print OUT "$_\t"; } print OUT "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make a array of hashes and search them
by moritz (Cardinal) on Feb 17, 2012 at 19:58 UTC | |
|
Re^2: How to make a array of hashes and search them
by aaron_baugher (Curate) on Feb 18, 2012 at 02:03 UTC |