0
|
1 #!/usr/bin/perl
|
|
2 use warnings;
|
|
3 use strict;
|
|
4 open(FH,$ARGV[0]) or die "Couldn't open file, $!";
|
|
5 open(DH,">$ARGV[4]") or die "Couldn't open file, $!";
|
|
6 my $first_line = scalar <FH>;
|
|
7 chomp($first_line);
|
|
8 $first_line = join(",",$first_line,"outcome\n");
|
|
9 print DH $first_line;
|
|
10 while(<FH>){chomp($_);
|
|
11 my $line= join(",",$_,"$ARGV[1]\n");
|
|
12 print DH $line;
|
|
13 }
|
|
14 close FH;
|
|
15 open(SH,$ARGV[2]) or die "Coudn't open file,$!";
|
|
16 scalar <SH>;
|
|
17 while(<SH>){
|
|
18 if($ARGV[1] ne $ARGV[3]){chomp($_);
|
|
19 my $line1= join(",",$_,"$ARGV[3]\n");
|
|
20 print DH $line1;
|
|
21 }
|
|
22 else{ print ("There is error to assign activity\n");exit;}
|
|
23 }
|
|
24 close SH;
|
|
25 close DH;
|