From 57646c41189df6004bb757688aebc712d5c429fd Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 22 Oct 2020 21:22:14 +0200 Subject: xml2json: optionally print missing stations most belong to SEV though --- share/xml2json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/xml2json b/share/xml2json index 8769a94..4429245 100755 --- a/share/xml2json +++ b/share/xml2json @@ -20,10 +20,17 @@ for my $station ( $tree->findnodes('//station') ) { my $eva = $station->getAttribute('eva'); my $ds100 = $station->getAttribute('ds100'); + my $found = 0; + for my $j_station ( @{$stations} ) { my $j_name = $j_station->{name}; my $j_ds100 = $j_station->{ds100}; my $j_eva = $j_station->{eva}; + + if ( $name eq $j_name or $eva == $j_eva ) { + $found = 1; + } + if ( $j_ds100 eq $ds100 and $j_name ne $name ) { printf( "%8s has been renamed: %30s -> %30s\n", $ds100, $j_name, $name ); @@ -44,6 +51,12 @@ for my $station ( $tree->findnodes('//station') ) { last; } } + + if ( not $found + and not( $ds100 =~ m{ ^ [OPXZ] }x or $name =~ m{ ^ Bahnhof, }x ) ) + { + #say "missing $eva $ds100 \"$name\""; + } } my $json_out = JSON->new->utf8->canonical->pretty->encode($stations); -- cgit v1.2.3