in reply to Re: reg reggular expressions
in thread reg reggular expressions

if the file is like this..
mmu-miR-16-1-3p 8
mmu-miR-1-1-3p 8
mmu-miR-500
mmu-miR-16-1-3p 8
i need to identify how many individal patterns are available; how many repeats are there for each individual. thank you

Replies are listed 'Best First'.
Re^3: reg reggular expressions
by kielstirling (Scribe) on Feb 09, 2012 at 07:12 UTC
    Hi,

    I would use a hash..

    #!/usr/bin/perl -w use strict; my @files = ( "mmu-miR-16-1-3p 8", "mmu-miR-1-1-3p 8", "mmu-miR-500", "mmu-miR-16-1-3p 8" ); my %pattern_count; map $pattern_count{$_}++, @files; print "filename $_ patten count $pattern_count{$_}\n" for keys %pattern_count;

      ya this seems to be a better option. however i cant give each pattern individually in quotes so i ll make it read from a file. thank you.