Mercurial > repos > anmoljh > activity_files_merge
annotate merge_activity_files.pl @ 0:b06d2e06b740 draft
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
author | anmoljh |
---|---|
date | Thu, 31 May 2018 11:24:57 -0400 |
parents | |
children |
rev | line source |
---|---|
0
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
1 #!/usr/bin/perl |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
2 use warnings; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
3 use strict; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
4 open(FH,$ARGV[0]) or die "Couldn't open file, $!"; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
5 open(DH,">$ARGV[4]") or die "Couldn't open file, $!"; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
6 my $first_line = scalar <FH>; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
7 chomp($first_line); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
8 $first_line = join(",",$first_line,"outcome\n"); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
9 print DH $first_line; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
10 while(<FH>){chomp($_); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
11 my $line= join(",",$_,"$ARGV[1]\n"); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
12 print DH $line; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
13 } |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
14 close FH; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
15 open(SH,$ARGV[2]) or die "Coudn't open file,$!"; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
16 scalar <SH>; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
17 while(<SH>){ |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
18 if($ARGV[1] ne $ARGV[3]){chomp($_); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
19 my $line1= join(",",$_,"$ARGV[3]\n"); |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
20 print DH $line1; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
21 } |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
22 else{ print ("There is error to assign activity\n");exit;} |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
23 } |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
24 close SH; |
b06d2e06b740
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
25 close DH; |