1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
|
#!/usr/bin/perl
use strict;
my (%t,%c,%tlm,%seen,%seen1,%notStarted,%notStartedT,%informationT,%information,%running,%completed,%runningT,%completedT);
open(F1, "<test.txt");
while(<F1>){
my @e_data=split/\|/;
$t{$e_data[0]}=[@e_data[1,2]];
}
open(F2, "<times.csv");
while(<F2>){
my @analys_data=split/,/;
$c{$analys_data[0]}=[@analys_data[1,2,3,4]] if $t{$analys_data[0]}
}
for my $key (keys %t ){
#print "KEY: $c{$analys_data[0]}\n";
next unless $c{$key};
if ($t{$key}[0] eq ""){
push @{$notStarted{$key}},"Not Started\n";
}
elsif ($t{$key}[1] =~ /^(\D+)/){
push @{$information{$key}},"Information\n";
}
elsif (sprintf("%02d:%02d:%s",split/:/,$c{$key}[1]) lt sprintf("%02d:%02d:%s",split/:/,$t{$key}[1])){
push @{$running{$key}},"Long Running\n";
}
else {
push @{$completed{$key}},"Completed\n";
}
}
print "BETL files summary: \n";
my @a=(keys %running, %completed);
for (sort(@a)){
next if $seen{$_}++;
print "$_:";
print "@{$running{$_}}\n" if defined $running{$_};
print "@{$completed{$_}}\n" if defined $completed{$_};
}
####################################################################################################
open(F3, "<tlm_b.txt");
while(<F3>){
my @t_data=split/\|/;
$tlm{$t_data[0]}=[@t_data[1,2]];
}
for my $keyt (keys %tlm ){
#print "KEY: $c{$analys_data[0]}\n";
next unless $c{$keyt};
if ($tlm{$keyt}[0] eq ""){
push @{$notStartedT{$keyt}},"Not Started\n";
}
elsif ($tlm{$keyt}[1] =~ /^(\D+)/){
push @{$informationT{$keyt}},"Information\n";
}
elsif (sprintf("%02d:%02d:%s",split/:/,$c{$keyt}[3]) lt sprintf("%02d:%02d:%s",split/:/,$tlm{$keyt}[1])){
push @{$runningT{$keyt}},"Long Running\n";
}
else {
push @{$completedT{$keyt}},"Completed\n";
}
}
print "BTLM files summary: \n";
my @b=(keys %runningT, %completedT);
for (sort(@b)){
next if $seen1{$_}++;
print "$_:";
print "@{$runningT{$_}}\n" if defined $runningT{$_};
print "@{$completedT{$_}}\n" if defined $completedT{$_};
}
test.txt
TION|05:06:27|05:10:42|00:04:15
ANCE|05:10:46|05:11:52|00:01:06
SAC|04:39:25|05:20:45|00:41:20
tlm_b.txt
ANCE|10:21::25|10:24::03|00:02:38
TION|10:24::03|10:44::06|00:20:03
SAC|10:31::32|10:42::07|00:10:35
|