g201
This commit is contained in:
@@ -26,6 +26,9 @@ sub getTimeStamp
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub getUnitName { # parm => file received ($trfile)
|
sub getUnitName { # parm => file received ($trfile)
|
||||||
|
my ($filename) = @_;
|
||||||
|
my ( $fileDate, $fileTime );
|
||||||
|
my ( $unittype, $unit );
|
||||||
if ( $filename = m/^(\d\d\d\d\d\d\d\d\d\d\d\d\d\d_)(G201_ID\d\d\d\d_DT\d\d\d\d)$/i ) { # GD201
|
if ( $filename = m/^(\d\d\d\d\d\d\d\d\d\d\d\d\d\d_)(G201_ID\d\d\d\d_DT\d\d\d\d)$/i ) { # GD201
|
||||||
my @strings = $filename =~ /(.{1,4})(.{1,2})(.{1,2})(.{1,2})(.{1,2})(.{1,2})_(.{1,4})_(.{1,6})_(.{1,6}).*/;
|
my @strings = $filename =~ /(.{1,4})(.{1,2})(.{1,2})(.{1,2})(.{1,2})(.{1,2})_(.{1,4})_(.{1,6})_(.{1,6}).*/;
|
||||||
$fileDate = $strings[0] . "/" . $strings[1] . "/" . $strings[2];;
|
$fileDate = $strings[0] . "/" . $strings[1] . "/" . $strings[2];;
|
||||||
@@ -33,11 +36,10 @@ sub getUnitName { # parm => file received ($trfile)
|
|||||||
$unittype = $strings[6];
|
$unittype = $strings[6];
|
||||||
$unit = $strings[7];
|
$unit = $strings[7];
|
||||||
} else {
|
} else {
|
||||||
my ($filename) = @_;
|
|
||||||
open FILE, $filename
|
open FILE, $filename
|
||||||
or warn getTimeStamp("log") . " >> Error: opening input file $filename\n";
|
or warn getTimeStamp("log") . " >> Error: opening input file $filename\n";
|
||||||
my ( $fileDate, $fileTime ) = split( /\s/, <FILE> );
|
( $fileDate, $fileTime ) = split( /\s/, <FILE> );
|
||||||
my ( $unittype, $unit ) = split( /\s/, uc <FILE> );
|
( $unittype, $unit ) = split( /\s/, uc <FILE> );
|
||||||
$unit =~ s/;+$//;
|
$unit =~ s/;+$//;
|
||||||
close FILE;
|
close FILE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user