ESSI | Online Home
EOF
my $file = "tempincid.html";
my $date = POSIX::strftime(
"%c",
localtime(
( stat $file )[9]
)
);
my $row = @{$te->rows};
print $config{'header'};
print "
";
foreach my $ts ($te->tables)
{
foreach my $row ($ts->rows)
{
print "
", join('
', @$row), "\n"; #########Every now and then the cell prints a stream of errors. I'm Guessing it is that character I can identify ####
print "
" , "\n";
}
}
print "
", "Dispatcher data last read $date", "";
my $numColumns = @{$te->rows->[0]};
my $numRows = @{$te->rows};
for my $rowIndex ( 0..$numRows-3 )
{
for my $columnIndex ( 0..$numColumns-1 )
{
my $cellvalue = $te->rows->[$rowIndex][7];
foreach ($cellvalue) {chomp;}
{
$cellvalue=uc($cellvalue);
if (($cellvalue =~ /BT/) || ($cellvalue =~ /FB/))
{
my $path = "C:/incidentnum/";
my $cellmatch = $te->rows->[$rowIndex][$columnIndex];
#******************************************************************************************##############################
#---------------Read each cell and as they are opened trim all whitespaces from the left and right side-----------------#
#------There is still some non-viewable (Null space, non-printable character to the left of the incident number.--------#
#########################################################################################################################
my $cell1=$te->rows->[$rowIndex][1];
$cell1 =~ s/^\s+|\s+//g;
$cell1 =~ s/^\s+|\s(?=\s)|\s+$//g;
my $cell2=$te->rows->[$rowIndex][2];
$cell2 =~ s/^\s+|\s+$//g;
my $cell3=$te->rows->[$rowIndex][3];
$cell3 =~ s/^\s+|\s+$//g;
my $cell4=$te->rows->[$rowIndex][4];
$cell4 =~ s/^\s+|\s+$//g;
my $cell5=$te->rows->[$rowIndex][5];
$cell5 =~ s/^\s+|\s+$//g;
my $cell7=$te->rows->[$rowIndex][7];
$cell7 =~ s/^\s+|\s+$//g;
my $row="$cell1, $cell2, $cell3, $cell4, $cell5, $cell7";
my $filename = $cell1."."."txt";
$filename =~ s/^\s+|\s+$//g;
#$filename =~ s/^S+|\S+$//g;
$path =~ s/^\s+|\s+$//g;
$path =~ s/^\s+|\s(?=\s)|\s+$//g;
my $full ="$path$filename";
open (FILE, '>', $filename) or die("Couldn't open $filename");
print FILE "$row";
close(FILE)or die $!;
my $powershell = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe';
my $mboxScript = 'C:\inetpub\cgi-bin\EmailAlert.ps1';
my $result = `$powershell -command "$mboxScript"`;
print "$powershell\n";
print "$mboxScript\n";
goto EEND;
}
}
}
}
EEND:
exit 0;