in reply to Re: counting occurances
in thread counting occurances
It's been a while since I've used perl, so i'm very very rusty. Thankswhile(<FILE>){ (s!>.*(\n)!!); my @words = (A, C, G, T); #letters to search my @file = split (/\w/g, <FILE>); #split each letter into an array foreach $file (@file){ foreach $words (@words){ if ($file eq $words){ $word_list{words}++; } } } @pairs = sort {$a->[1] <=> $b->[1]} map {[ $_ => $word_list{$_}]} keys %word_list; print "word $_ ->[0] = $_->[1]\n" for @pairs;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: counting occurances
by davido (Cardinal) on Sep 19, 2003 at 20:03 UTC | |
|
Re: Re: Re: counting occurances
by shenme (Priest) on Sep 19, 2003 at 20:16 UTC | |
by shenme (Priest) on Sep 19, 2003 at 21:40 UTC | |
|
Re: Re: Re: counting occurances
by qmole (Beadle) on Sep 19, 2003 at 20:03 UTC |