This commit is contained in:
2018-05-12 18:57:08 +02:00
parent 2cdd1423d3
commit 32b7853754
2 changed files with 27 additions and 10 deletions

View File

@@ -1,8 +1,19 @@
#!/usr/bin/perl
use warnings;
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);
print scalar @arr . ".\n"; # First way to print array size
my $fileDate = $strings[0] . "/" . $strings[1] . "/" . $strings[2];;
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";