g201 1
This commit is contained in:
@@ -36,9 +36,8 @@ my $ftp_passwd;
|
|||||||
my $ftp_parm;
|
my $ftp_parm;
|
||||||
my $ftp_filename;
|
my $ftp_filename;
|
||||||
my $ftp_target;
|
my $ftp_target;
|
||||||
my $unit_id;
|
my ($unit_id, $unit, $unittype);
|
||||||
my $unit;
|
my ($fileDate, $fileTime);
|
||||||
my $unittype;
|
|
||||||
my $matlab_rt = "/usr/local/MATLAB/MATLAB_Runtime/v93";
|
my $matlab_rt = "/usr/local/MATLAB/MATLAB_Runtime/v93";
|
||||||
my $matlab_func_dir = "/usr/local/matlab_func/";
|
my $matlab_func_dir = "/usr/local/matlab_func/";
|
||||||
|
|
||||||
@@ -356,10 +355,17 @@ if ( $db_name ne 'asega' ) {
|
|||||||
else {
|
else {
|
||||||
$db_name = 'ase_lar';
|
$db_name = 'ase_lar';
|
||||||
}
|
}
|
||||||
|
if ( $filename = m/^(\d\d_\d\d\d\d_|)(DT\d\d\d\d|LOC\d.*|GD\d*)$/i ) { # GD801
|
||||||
my ( $fileDate, $fileTime ) = split( /\s/, <FILE> );
|
($fileDate, $fileTime) = split( /\s/, <FILE> );
|
||||||
($unittype, $unit ) = split( /\s/, uc <FILE> );
|
($unittype, $unit ) = split( /\s/, uc <FILE> );
|
||||||
$unit =~ s/;+$//;
|
$unit =~ s/;+$//;
|
||||||
|
} elsif ( $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}).*/;
|
||||||
|
$fileDate = $strings[0] . "/" . $strings[1] . "/" . $strings[2];;
|
||||||
|
$fileTime = $strings[3] . ":" . $strings[4] . ":" . $strings[5];
|
||||||
|
$unittype = $strings[6];
|
||||||
|
$unit = $strings[7];
|
||||||
|
}
|
||||||
|
|
||||||
while ( my $line = <FILE> ) {
|
while ( my $line = <FILE> ) {
|
||||||
my ( $first, $NodeData ) = split( /;/, $line, 2 );
|
my ( $first, $NodeData ) = split( /;/, $line, 2 );
|
||||||
|
|||||||
17
prova.pl
17
prova.pl
@@ -1,8 +1,19 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
|
my $string= "20180418103606_G201_ID1111_DT2222.csv";
|
||||||
|
my @strings = $string =~ /(.{1,4})(.{1,2})(.{1,2})(.{1,2})(.{1,2})(.{1,2})_(.{1,4})_(.{1,6})_(.{1,6}).*/;
|
||||||
|
foreach(@strings) {
|
||||||
|
print "$_\n";
|
||||||
|
}
|
||||||
|
|
||||||
use Data::Dumper qw(Dumper);
|
|
||||||
|
|
||||||
my @arr = (2,3,4,5,6);
|
my $fileDate = $strings[0] . "/" . $strings[1] . "/" . $strings[2];;
|
||||||
print scalar @arr . ".\n"; # First way to print array size
|
my $fileTime = $strings[3] . ":" . $strings[4] . ":" . $strings[5];
|
||||||
|
my $unittype = $strings[6];
|
||||||
|
my $unit = $strings[7];
|
||||||
|
|
||||||
|
print $fileDate . "\n";
|
||||||
|
print $fileTime . "\n";
|
||||||
|
print $unittype . "\n";
|
||||||
|
print $unit . "\n";
|
||||||
Reference in New Issue
Block a user