Debian Codegraph @

tcl/ex/red-pd/singleVsMulti/singleVsMulti.pl

raw
1 #!/usr/bin/perl -w
2
3 use strict 'refs';
4 use strict 'subs';
5
6 if ($#ARGV < 0) {
7 &usage;
8 exit;
9 }
10
11 sub usage {
12 print STDERR " usage: $0 <filepattern> \n";
13 exit;
14 }
15
16 my @a = <$ARGV[0]*>;
17
18 foreach $file (@a) {
19
20 my ($pre, $suffix) = split(/-/,$file);
21
22 print STDERR "Doing $file \n";
23
24 my $command2 = "grep \'1:1-3\' $file | awk \'{if (\$1==\"1:1-3-identified\") idCount++; count++} END {print $suffix*1000, idCount/count, idCount, count}\' >> data-s";
25
26 system($command2);
27
28 my $command3 = "grep \'3:5\' $file | awk \'{if (\$1==\"3:5-identified\") idCount++; count++} END {print $suffix*1000, idCount/count, idCount, count}\' >> data-m";
29
30 system($command3);
31
32 }
33