Debian Codegraph @

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

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