Guest User

Untitled

a guest
Apr 27th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #!bin/sh
  3.  
  4. my $file1={};
  5. my $file2={};
  6. my @line1;
  7. my $I1=0;
  8. my $I2=0;
  9.  
  10. system("cls");
  11.  
  12. my $nfile = shift @ARGV;
  13.  
  14. open file1, $nfile or die "Couldn't open file $input_results: $!\n";
  15. $nfile = shift @ARGV;
  16. my $line1=<file1>;
  17. while (<file1>) {
  18. @line1=split(' ',$_);
  19. print $_, "\n";
  20. # print @line1[4]," ",@line1[8],"\n";
  21. open file2, $nfile or die $!;
  22. while (<file2>)
  23. {
  24. @line2=split(' ',$_);
  25. $I2=0;
  26. for ($I1=3, $I1=6,$I1++)
  27. {
  28. if (@line2[$I1]==@line1[4]) { $I2=$I2+1;}
  29. if (@line2[$I1]==@line1[8]) { $I2=$I2+1;}
  30. }
  31. if ( $I2==2) { print $I2, " ",$_, "\n";} else {print $I2," ",@line1[4]," ",@line2[3],"\n";}
  32. }
  33. print "-----------------------------------------","\n",
  34. close(file2);
  35.  
  36.  
  37. }
  38.  
  39.  
  40. print "\nDone!\n";
  41.  
  42. close file1;
Add Comment
Please, Sign In to add comment