Thread Dateien durchsuchen (29 answers)
Opened by Paul at 2013-01-30 21:28

Gast Paul
 2013-01-31 16:28
#165361 #165361
Sorry, hab beim Säubern der Datei einen kleinen Fehler eingebaut.

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
open (C,">${OUTPATH}/${C}");

open (A,"<${OUTPATH}/${A}");
@file_a=<A>;
close (A) or die "Cannot write $A file\n";


my $ll;

my $zeile;

$ll=1;

foreach $zeile (@lfile)
{

chomp ($file[$ll]);


$VALUE=substr($file[$ll],0,20);

chomp ($VALUE);

$VALUE = $VALUE * 1;


open (B,"<${OUTPATH}/${B}") or die " Cannot open file $B for reading\n";
@file_b=<B>;
close (B) or die "Cannot write $B file\n";


my $LINE;

my @grep;

@grep = (grep {$_ =~ /${VALUE}/} @file);

$LINE = @grep;

if ( $LINE eq 1 )
{

chomp ($grep[0]);

print C "$grep[0]";

}
else
{
print C "$file[$ll]";
};

$ll++;

};


close (C) or die "Cannot write $C file\n";

Last edited: 2013-01-31 16:53:53 +0100 (CET)

View full thread Dateien durchsuchen