#!/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"; } } } }
In reply to Re^2: Open a zip file content question!
by Anonymous Monk
in thread Open a zip file content question!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |