poj#!perl use strict; use warnings; use XML::Twig; my $filename = 'trec7_4collections.txt'; our $num; my $fh; for $num (351..354){ open $fh,'>',$num.'.xml' or die "$!"; my $twig = XML::Twig->new( twig_handlers => { query => \&query }, pretty_print=>'indented' ); $twig->parsefile($filename); $twig->flush($fh); print "Created $num.xml\n"; } sub query { my( $twig, $e) = @_; my $n = $e->first_child_text('number'); $e->cut if ($n ne $num); }
In reply to Re^2: RAM, "
by poj
in thread Make a perl script by taking specific lines from a txt file
by nimpoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |