5 Einträge, 1 Seite |
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
26
27
28
29
30
use warnings;
use diagnostics;
use Archive::Zip;
use Archive::Zip::MemberRead;
$String = "strict"; #Such String
@file = glob ("*.zip");
foreach $file (@file){
$zip = new Archive::Zip($file);
print "$file\n";
} #Liste der *.ZIP Dateien
@file2 = qw (PIXX_SRV_LF5.LOG
PIXX_SRV_LF5.LOG.1
Datei.log
); #Verschieden Dateien im ZIP Archive
foreach $file2 (@file2){
$fh = new Archive::Zip::MemberRead($zip, $file2);
$zeile = 0;
print "$file2\n";
}
while (defined($line = $fh->getline())) {
chomp($line);
++$zeile;
if ($line =~ /$String/) {
print "Found in Line $zeile: $line\n in ZipFile $file File $file2\n";
$fh->close();
}
}
1
2
3
4
5
file = glob ("*.zip");
foreach $file (@file){
$zip = new Archive::Zip($file);
print "$file\n";
}
1
2
3
4
5
6
7
8
9
@file2 = qw (PIXX_SRV_LF5.LOG
PIXX_SRV_LF5.LOG.1
Datei.log
);
foreach $file2 (@file2){
$fh = new Archive::Zip::MemberRead($zip, $file2);
$zeile = 0;
print "$file2\n";
}
1
2
3
4
5
6
7
while (defined($line = $fh->getline())) {
chomp($line);
++$zeile;
if ($line =~ /$String/) {
print "Found in Line $zeile: $line\n in ZipFile $file File file2\n";
}
$fh->close();
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
26
27
28
29
use warnings;
use strict;
use diagnostics;
use Archive::Zip;
use Archive::Zip::MemberRead;
$String = "strict"; #Such String
my @file2 = qw (PIXX_SRV_LF5.LOG
PIXX_SRV_LF5.LOG.1
Datei.log );#Verschieden Dateien im ZIP Archive
my @file = glob ("*.zip");
foreach my $file (@file){
my $zip = new Archive::Zip($file);
print "$file\n";
foreach my $file2 (@file2){
my $fh = new Archive::Zip::MemberRead($zip, $file2);
my $zeile = 0;
while (defined($line = $fh->getline())) {
chomp($line);
++$zeile;
if ($line =~ /$String/) {
print "Found in Line $zeile: $line\n in ZipFile $file File $file2\n";
$fh->close();
}
}
print "$file2\n";
}
}#Liste der *.ZIP Dateien
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings;
use diagnostics;
use Archive::Zip;
use Archive::Zip::MemberRead;
#****************************
# Search String
#****************************
my $String = "strict";
#****************************
# Search over all ZIP Files
#****************************
my @Zip_File = glob ("*.zip");
for my $Zip_File (@Zip_File){
#****************************
#
#****************************
my $zip = new Archive::Zip($Zip_File);
#****************************
# Files to be read
#****************************
my @file2 = qw (Datei1.log PIXX_SRV_LF5.LOG);
for my $file2 (@file2){
#****************************
# Open Zip Archive for
# reading Files
#****************************
my $fh = new Archive::Zip::MemberRead($zip, $file2);
#****************************
# Line number call for
# Search String
#****************************
my $zeile = 0;
while (defined(my $line = $fh->getline())) {
chomp($line);
++$zeile;
if ($line =~ /$String/) {
print "Found in Line $zeile: $line\n in ZipFile $Zip_File File $file2\n\n";
}
}
$fh->close();
}
}
5 Einträge, 1 Seite |