Thread unnötiges löschen? (5 answers)
Opened by Gast at 2008-01-21 14:54

renee
 2008-01-22 14:33
#105023 #105023
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
my $dir = 'test2';
opendir(DIR,$dir) or die $!;
while($datei = readdir(DIR)){
my $path = $dir . '/' . $datei;
next unless -f $path;
my @entries;
{
my $measure;
local $/ = "\nDUT No\n";
open my $fh, '<', $path or die $!;
while( my $entry = <$fh> ){
chomp $entry;
@mms = $entry =~ /Measurement:\s*([\d.]+)/;
$measure = $mms[0] unless defined $measure;
if(grep{ $_ == $measure }@mms){
$entry = "DUT No\n". $entry unless $entry =~ /^DUT No/;
push @entries, $entry;
}
}
}

print $_,"\n" for @entries;
close OUTPUT;

}
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/

View full thread unnötiges löschen?