multi.pl
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:1k
源码类别:

通讯编程

开发平台:

Visual C++

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