Thread Logs zählen
(33 answers)
Opened by la_dy82 at 2011-01-09 15:42
Da das Datum im Format YYYY.MM.DDDD vorliegt, würde ich das wohl so machen...
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 use File::Find::Rule; my $start = '20110106'; my $dir = '/path/to/dir/with/log/files/'; my @files = File::Find::Rule->file->name( 'meinDat_*.log' )->in( $dir ); my @wanted; for my $file ( @files ) { my ($date) = $file =~ /meinDat_(\d{4}\.\d\d\.\d\d)\.log/; $date =~ s/\.//g; next if $date < $start; push @wanted, $file; } use Data::Dumper; print Dumper \@wanted; OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |