8 entries, 1 page |
Quote0402100397988BZ ALTREI B. JOHANNES ZWERGER PLATZ 5 39040 DIREZIONE DIDATTICA PER LA SCUOLA LINGUA TEDESCA ORA NON RICON.87932000471882144 001ED0DSCUOLE DI INSEGNAMENTO PUBBLICO S 80024320212 2K040487827000000001*
Quote00099430217
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
#!/usr/bin/perl
open(F1, "/home/hallohallo/sales/seatTOT") || die "Can't open the file: seatTOT\n";
while (<F1>) {
chop;
push (@SEAT , $_);
$newSEAT = substr(@SEAT, 394, 16);
}
close (F1);
open(F2, "/home/hallohallo/sales/CLIENTI_BKOM") || die "Can't open the file CLIENTI_BKOM\n";
while (<F2>) {
chop;
$PI{$_} = 1;
}
close (F2);
#$newSEAT = $newSEAT {substr($PI, 394, 16)};
foreach $LL (@SEAT) {
if ($newSEAT{$LL} == 1) {
print $LL . "\n";
}
}
#print $SEAT[2000];
exit;
~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %hash = ( 16 => 1, 17 =>1, 145 => 1 );
my @array = qw( 192 16 168 17 145 139 97 43 74);
my @results;
foreach my $id (0 .. $#array) {
push @results, $array[$id] unless (scalar grep(/$id/, keys %hash));
}
print Dumper(\@results);
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
# Variablen deklarieren
my @lines_file1 = ();
my %hash = ();
# Pfade zu den Dateien
my $file1 = 'Pfad/zur/Datei1';
my $file2 = 'Pfad/zur/Datei2';
my $out = 'Pfad/zur/Zieldatei';
# einlesen der 1. Datei
open(R_FILEONE,"<$file1") or die $!;
while(my $line = <R_FILEONE>){
push(@lines_file1,$line);
}
close R_FILEONE;
# einlesen der 2. Datei
open(R_FILETWO,"<$file2") or die $!;
while(my $line = <R_FILETWO>){
chomp $line;
$hash{$line} = 1;
}
close R_FILETWO;
# überprüfen, ob die Zeile aus der 1.Datei eine Zahl aus der 2. Datei enthält
foreach(@lines_file1){
my $check = substr($_,394,16); # Zahl in der langen Zeile raussuchen
if($hash{$check}){
$_ = '';
}
}
# Zieldatei schreiben
open(W_TARGET,">$out") or die $!;
foreach(@lines_file1){
print W_TARGET $_ if($_);
}
close W_TARGET;
push @results, $array[$id] unless (scalar grep(/$id/, keys %hash));
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
#!/usr/bin/perl
use warnings;
use strict;
open(EIN, "<Datei2.txt") or die $!;
my (%pnr1, $cnt);
$cnt = 0;
while(<EIN>) {
chomp;
my @f = split(/\t/);
$pnr1{join('|',@f[1..2])} = 1;
++$cnt % 1000 or print "Bei Satz $cnt.\n"
} # while
print "Fertig mit $cnt Saetzen.\n";
close(EIN) or die $!;
open(EIN, "<Datei2.txt") or die $!;
open(AUS, ">Gefunden.txt") or die $!;
$cnt = 0;
while(<EIN>) {
my $vergleich = su_strip(su_strip(substr($_,67,30))."|".substr($_,157,30));
print AUS $_ if defined $pnr1{$vergleich};
++$cnt % 1000 or print "Bei Satz $cnt.\n"
} # while
print "Fertig mit $cnt Saetzen.\n";
close(EIN) or die $!;
close(AUS) or die $!;
sub su_strip {
my $s = shift;
$s =~ s/\s+$//;
$s =~ s/^\s+//;
$s;
}
QuoteCode: (dl )my $vergleich = su_strip(su_strip(substr($_,67,30))."|".substr($_,157,30));
8 entries, 1 page |