line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::PVMForImportAfterExport;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
96851
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
5
|
1
|
|
|
1
|
|
878
|
use String::StringLight qw( trim );
|
|
1
|
|
|
|
|
484
|
|
|
1
|
|
|
|
|
96
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.06';
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN {
|
10
|
1
|
|
|
1
|
|
7
|
use Exporter;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
11
|
1
|
|
|
1
|
|
14
|
our @ISA = qw( Exporter );
|
12
|
1
|
|
|
|
|
3
|
our @EXPORT = qw( );
|
13
|
1
|
|
|
|
|
2
|
our %EXPORT_TAGS = ( );
|
14
|
1
|
|
|
|
|
13234
|
our @EXPORT_OK = qw( &PvmDateiErstellen &AdresslisteDazu );
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub PvmDateiErstellen {
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
0
|
|
my ($dateiEin, $dateiPvm, $aufbau, $idStelle, $idLaenge, $lkzStelle, $lkzLaenge, $plzStelle, $plzLaenge, $buendelung) = @_;
|
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
open(my $fhEin, "<", $dateiEin) or die $!;
|
22
|
0
|
0
|
|
|
|
|
open(my $fhPvm, ">", $dateiPvm) or die $!;
|
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
print $fhPvm join(";", "PLZ", "ID")."\n";
|
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
while(my $zeile = <$fhEin>) {
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
chomp $zeile;
|
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my ($lkz, $plz, $pvmSatz) = ("", "", "");
|
31
|
0
|
0
|
|
|
|
|
if ($aufbau =~ m/^D/) {
|
32
|
0
|
|
|
|
|
|
my @satz = ();
|
33
|
0
|
|
|
|
|
|
@satz = split(substr($aufbau,1), $zeile);
|
34
|
0
|
|
|
|
|
|
$lkz = trim($satz[$lkzStelle - 1]);
|
35
|
0
|
|
|
|
|
|
$plz = trim($satz[$plzStelle - 1]);
|
36
|
0
|
0
|
|
|
|
|
$pvmSatz = join(";", $plz, trim($satz[$idStelle - 1]))."\n" if $buendelung eq "J";
|
37
|
0
|
0
|
|
|
|
|
$pvmSatz = join(";", $plz, $.)."\n" if $buendelung eq "N";
|
38
|
|
|
|
|
|
|
} # if
|
39
|
|
|
|
|
|
|
else {
|
40
|
0
|
|
|
|
|
|
$lkz = trim(substr($zeile,$lkzStelle - 1,$lkzLaenge));
|
41
|
0
|
|
|
|
|
|
$plz = trim(substr($zeile,$plzStelle - 1,$plzLaenge));
|
42
|
0
|
0
|
|
|
|
|
$pvmSatz = join(";", $plz, trim(substr($zeile,$idStelle - 1,$idLaenge)))."\n" if $buendelung eq "J";
|
43
|
0
|
0
|
|
|
|
|
$pvmSatz = join(";", $plz, $.)."\n" if $buendelung eq "N";
|
44
|
|
|
|
|
|
|
} # else
|
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
print $fhPvm $pvmSatz if $lkz eq "A";
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} # while
|
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
|
close($fhEin) or die $!;
|
51
|
0
|
0
|
|
|
|
|
close($fhPvm) or die $!;
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} # PvmDateiErstellen
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub AdresslisteDazu {
|
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
0
|
0
|
|
my ($dateiAdrListe, $dateiEin, $dateiAus, $idStelle, $idLaenge, $aufbau) = @_;
|
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
open(my $fhAdrListe, "<", $dateiAdrListe) or die $!;
|
60
|
0
|
|
|
|
|
|
my %pnr;
|
61
|
0
|
|
|
|
|
|
while(my $zeile = <$fhAdrListe>) {
|
62
|
0
|
|
|
|
|
|
chomp $zeile;
|
63
|
0
|
|
|
|
|
|
my @satz = ();
|
64
|
0
|
|
|
|
|
|
@satz = split(/;/, $zeile);
|
65
|
0
|
0
|
|
|
|
|
defined $satz[8] or $satz[8] = "";
|
66
|
0
|
0
|
|
|
|
|
defined $satz[9] or $satz[9] = "";
|
67
|
0
|
0
|
|
|
|
|
if ($aufbau =~ m/^D/) {
|
68
|
0
|
|
|
|
|
|
$pnr{$satz[2]} = join(substr($aufbau,1), $satz[0], @satz[3..9]);
|
69
|
|
|
|
|
|
|
} # if
|
70
|
|
|
|
|
|
|
else {
|
71
|
0
|
|
|
|
|
|
$pnr{$satz[2]} = sprintf("%-11s", $satz[0]).sprintf("%-3s", $satz[3]).sprintf("%-3s", $satz[4]).sprintf("%-3s", $satz[5]).
|
72
|
|
|
|
|
|
|
sprintf("%-1s", $satz[6]).sprintf("%-2s", $satz[7]).sprintf("%-1s", $satz[8]).sprintf("%-1s", $satz[9]);
|
73
|
|
|
|
|
|
|
} # else
|
74
|
|
|
|
|
|
|
} # while
|
75
|
0
|
0
|
|
|
|
|
close($fhAdrListe) or die $!;
|
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
|
open(my $fhEin, "<", $dateiEin) or die $!;
|
78
|
0
|
0
|
|
|
|
|
open(my $fhAus, ">", $dateiAus) or die $!;
|
79
|
0
|
|
|
|
|
|
while(my $zeile = <$fhEin>) {
|
80
|
0
|
|
|
|
|
|
chomp $zeile;
|
81
|
0
|
0
|
|
|
|
|
if ($aufbau =~ m/^D/) {
|
82
|
0
|
|
|
|
|
|
my @satz = ();
|
83
|
0
|
|
|
|
|
|
@satz = split(substr($aufbau,1), $zeile);
|
84
|
|
|
|
|
|
|
# bei delimitedAusgabe nicht so "dramatisch", wenn auch die zuvor eingefügte ID ausgegegen wird, darum @satz...
|
85
|
0
|
|
|
|
|
|
print $fhAus join(substr($aufbau,1), @satz, $pnr{trim($satz[$idStelle - 1])})."\n";
|
86
|
|
|
|
|
|
|
} # if
|
87
|
|
|
|
|
|
|
else {
|
88
|
0
|
|
|
|
|
|
print $fhAus substr($zeile,0,$idStelle - 1).$pnr{trim(substr($zeile,$idStelle - 1,$idLaenge))}."\n";
|
89
|
|
|
|
|
|
|
} # else
|
90
|
|
|
|
|
|
|
} # while
|
91
|
0
|
0
|
|
|
|
|
close($fhEin) or die $!;
|
92
|
0
|
0
|
|
|
|
|
close($fhAus) or die $!;
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
} # AdresslisteDazu
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1;
|
97
|
|
|
|
|
|
|
__END__
|