view merge_activity_files.pl @ 0:b06d2e06b740 draft

planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
author anmoljh
date Thu, 31 May 2018 11:24:57 -0400
parents
children
line wrap: on
line source

#!/usr/bin/perl 
use warnings;
use strict;
open(FH,$ARGV[0])  or die "Couldn't open file, $!";
open(DH,">$ARGV[4]") or die "Couldn't open file, $!";
my $first_line = scalar <FH>;
chomp($first_line);
$first_line = join(",",$first_line,"outcome\n");
print DH $first_line;
while(<FH>){chomp($_);
my $line= join(",",$_,"$ARGV[1]\n");
print DH $line;
}
close FH;
open(SH,$ARGV[2]) or die "Coudn't open file,$!";
scalar <SH>;
while(<SH>){ 
if($ARGV[1] ne $ARGV[3]){chomp($_);
my $line1= join(",",$_,"$ARGV[3]\n");
print DH $line1;
}
else{ print ("There is error to assign activity\n");exit;}
}
close SH;
close DH;