Dan Muey wrote: > I'm looking at Archive::Zip to extract a single text file from a zip file that is > ftped from a winders box to a unix box. > > The zip file conatins only one file, a .txt file, that is compressed pretty well. > (about 170 MB regular 18MB zipped up) > > Data.txt is apx 170MB > Data.txt is zipped into 'data.zip' which is 18MB > File 'data.zip' is ftped from winders to unix server > Now heres' where my perl script comes in: > > Perl/Archive::Zip (or other module???) > Extracts data.txt from data.zip and writes it to 'local_data.txt' > > Any pointers/ideas/experience about how to do that?
Hi Dan. The program below is the very basic stuff to do what you want. It does no error checking except to make sure that the zip file opened OK, and just extracts the first file in the archive with to a file with a name prefixed with "local_". You probably need some exception handling, but how much depends on your data. HTH, Rob use strict; use warnings; use Archive::Zip; my $zip = Archive::Zip->new('data.zip') or die "Failed to open zip file"; my ($member) = $zip->members; my $file = $member->fileName; $member->extractToFileNamed("local_$file"); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]