in reply to Re^4: preserving hash value outside the loop -- silly oneliner
in thread preserving hash value outside the loop
Here mines:
#cat gen1.txt @gi AGAT + AAAA 1:1.txt @gi CATT + AAAAA 3:1.txt #cat gen2.txt @gi AGAT + AAAA 1:2.txt @gi TACA + AAAA 2:2.txt perl -lane "BEGIN{$/=''}map{$h{$_}{s}.=' '.$F[4];$h{$_}{c}+=$1 if $F[ +4]=~/(\d+):/}join qq(\n),@F[0..3]; END{print map{qq($_ $h{$_}{c} $h{$_}{s}\n\n)} keys %h}" + gen1.txt gen2.txt @gi AGAT + AAAA 2 1:1.txt 1:2.txt @gi CATT + AAAAA 3 3:1.txt @gi TACA + AAAA 2 2:2.txt
L*
|
|---|