diff --git a/LoadCSVData.pl b/LoadCSVData.pl index a4ef483..a64d011 100755 --- a/LoadCSVData.pl +++ b/LoadCSVData.pl @@ -54,7 +54,11 @@ my $D2W_fcheck = 0; my $FtpToCustomerCmd = 'SendFtpElabData.pl'; my ( $scriptname, $scriptpath ); my $MatlabErrorFilename = "/tmp/"; -my $matlabOutputError = ''; +my @matlabOutputErrorArray; +my @errors; +my @warnings; +my $MatlabErrors = ''; +my $MatlabWarnings = ''; sub getTimeStamp { # parm [ts] => timestamp for filename; log => timestamp for log @@ -133,12 +137,16 @@ sub matlabCalc { or warn print getTimeStamp("log") . " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n"; { - local $/; - $matlabOutputError = <$fh>; + chomp( @matlabOutputErrorArray = <$fh> ); } close($fh); - $matlabOutputError =~ s/\n/
/g; + @matlabOutputErrorArray = grep( /\S/, @matlabOutputErrorArray ); + @errors = grep( /^Error/, @matlabOutputErrorArray ); + @warnings = grep( !/^Error/, @matlabOutputErrorArray ); + $MatlabErrors = join( "
", @errors ); + $MatlabWarnings = join( "
", @warnings ); my $exit_value = $? >> 8; + if ( $exit_value == 124 ) { print getTimeStamp("log") . " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n"; @@ -328,9 +336,14 @@ sub makeEmailMsg {

$matlab_error

+ + + $MatlabErrors + + - $matlabOutputError + $MatlabWarnings