Thread XML-Parser 2 Datei
(5 answers)
Opened by Henri at 2015-04-08 18:19
Hallo Leute ich habe etwas geschrieben aber möchte ich in der
Code (perl): (dl
)
twig2
Code (perl): (dl
)
fault
vielleicht konne jemand mir helfen. Code (perl): (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 use strict; use warnings; use XML::Twig; my $FileResult = 'result.txt'; open( my $FhResult, '>', $FileResult ) or die("Unable to open file $FileResult\n$!"); my $twig1= XML::Twig->new( twig_handlers => { 'Parameter' => sub { $, = ","; print $FhResult $_->{'att'}->{'name'}. $, } } ); print $FhResult( (split('_', "d100spuptl25e0_datei1.xml",2))[0] . ',' ); $twig1->parsefile("d100spuptl25e0_datei1.xml"); my $twig2= XML::Twig->new( twig_handlers => { 'Parameter' => sub { $, = ","; print $FhResult $_->{'att'}->{'value'} . $, } } ); print $FhResult( (split('_', "\ndefault_datei2.xml",2))[0] . ',' ); $twig2->parsefile('default_datei2.xml'); Last edited: 2015-04-08 23:02:09 +0200 (CEST) |