Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Open a zip file content question!

by Anonymous Monk
on Mar 04, 2011 at 15:05 UTC ( [id://891467]=note: print w/replies, xml ) Need Help??


in reply to Re: Open a zip file content question!
in thread Open a zip file content question!

Thanks to this last posting, I got the problem solved!!!
#!/usr/bin/perl use strict; use warnings; use Archive::Zip; use XML::XPath; my @numberstocheck = qw(112334 999888 222333 999888 0008877 003344 122 +2334 00009 004443 999888); my $zipfile = "test.zip"; my $fillThisFile = "$zipfile-junk.xml"; my $zip = Archive::Zip->new( $zipfile ) || die; my @xml = $zip->membersMatching( '.*\.XML' ); $zip->extractMember( $xml[0] , $fillThisFile ); my $xmlfile = XML::XPath->new(filename => $fillThisFile); foreach my $row ($xmlfile->findnodes('/alllist')) { my $nodeset = $row->find('phnumbers'); foreach my $node ( $nodeset->get_nodelist ) { my $numbers = $node->find( 'numbers')->string_value; print "\n 19 - $numbers \n"; foreach (@numberstocheck) { if (/^($numbers)/g) { print "$numbers - ".$_."\n"; } } } }

Thanks a lot for that!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://891467]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found