Thread XML Parsing aus Logfiles
(2 answers)
Opened by remo at 2009-04-07 15:21
Ganz schnell aus der holen Hand.
Wenn die XML-Struktur anders ist, anpassen... Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 use XML::Simple; my $xml=XMLin("datei.xml") or die "$!"; for my $sesstion ($xml->{"MessageRoot"}->{Session}) { my $ci = $session->{clientIdentifier}; my $dt = $session->{BncfInput}->{date}; my $or = $session->{BncfInput}->{origin}; my $cd = $session->{BncfInput}->{Code}; my $nr = $session->{BncfInput}->{Nr}; print "$ci : ($dt,$or,$cd,$nr)"; } |