<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Perl script to count the number of files in a directory with regex]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/36006/perl-script-to-count-the-number-of-files-in-a-directory-with-regex?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/36006/perl-script-to-count-the-number-of-files-in-a-directory-with-regex?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/36006/perl-script-to-count-the-number-of-files-in-a-directory-with-regex</guid>
	<pubDate>Wed, 21 Mar 2018 05:13:53 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/36006/perl-script-to-count-the-number-of-files-in-a-directory-with-regex</link>
	<title><![CDATA[Perl script to count the number of files in a directory with regex]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;
my @allNames=(&quot;_D14_&quot;,&quot;_B14_&quot;,&quot;_B15_&quot;,&quot;_C1T1_&quot;,&quot;_C3T3_&quot;,&quot;_D12_&quot;,&quot;_D13_&quot;,&quot;_E1B1_&quot;,&quot;_E1B3_&quot;,&quot;_H001_&quot;,&quot;_H3-03_&quot;,&quot;_H3-04_&quot;,&quot;_HB0_&quot;,&quot;_C28_&quot;,&quot;_C33_&quot;,&quot;_C31_&quot;,&quot;_C1T2_&quot;,&quot;_D11_&quot;,&quot;_E11_&quot;,&quot;_E31_&quot;,&quot;_B11_&quot;,&quot;_B33_&quot;,&quot;_B3B1_&quot;,&quot;_C210_&quot;,&quot;_C211_&quot;,&quot;_C21_&quot;,&quot;_C24_&quot;,&quot;_C27_&quot;,&quot;_E2B2_&quot;,&quot;_H004_&quot;,&quot;_H4-28_&quot;,&quot;_Hprim34_&quot;,&quot;_Hprim53_&quot;,&quot;_HPRIM1_&quot;,&quot;_HPRIM21_&quot;,&quot;_HPRIM22_&quot;,&quot;_HPRIM36_&quot;,&quot;_A110_&quot;,&quot;_A12_&quot;,&quot;_A11_&quot;,&quot;_A111_&quot;,&quot;_A112_&quot;,&quot;_A13_&quot;,&quot;_A14_&quot;,&quot;_A15_&quot;,&quot;_A18_&quot;,&quot;_A19_&quot;,&quot;_C29_&quot;,&quot;_Hprim18_&quot;,&quot;_D22_&quot;,&quot;_D23_&quot;,&quot;_D21_&quot;,&quot;_A16_&quot;,&quot;_A17_&quot;,&quot;_B24_&quot;,&quot;_A3B1_&quot;,&quot;_C2B4_&quot;,&quot;_B22_&quot;,&quot;_H3-14_&quot;,&quot;_Hprim54_&quot;,&quot;_Hprim12_&quot;,&quot;_H4-02_&quot;,&quot;_H4-04_&quot;,&quot;_HPRIM15_&quot;,&quot;_HPRIM19_&quot;,&quot;_B39_&quot;,&quot;_C3B1_&quot;,&quot;_C3T1_&quot;,&quot;_HPRIM16_&quot;,&quot;_A21_&quot;,&quot;_A22_&quot;,&quot;_A32_&quot;,&quot;_A33_&quot;,&quot;_A24_&quot;,&quot;_A25_&quot;,&quot;_A23_&quot;,&quot;_B34_&quot;,&quot;_B38_&quot;,&quot;_E3B2_&quot;,&quot;_E3T1_&quot;,&quot;_HPRIM14_&quot;,&quot;_H158_&quot;);

my @files = glob(&quot;*.scf *.SCF&quot;);
foreach my $name (@allNames) {
my $nName=lc ($name);
my $cnt=0;
foreach my $file (@files) {
#print &quot;$file =~ /$nName/\n&quot;;
	my $nFile =lc $file;
	$cnt++ if ($nFile =~ /$nName/);
        #print &quot;$file\n&quot;;
    }
print &quot;$cnt\n&quot;;
if ($cnt &gt; 2 or $cnt &lt; 2) { print &quot;$nName\n&quot;;}
}</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>