Вопрос

I have hundreds of ZIP archives and each of them contains 2000 to 4000 xml files in it. Now I need some way to get a text file that will contain list of these xml files or at least file counts from each archive.

Is there any application to do this, or can I do this through cmd or perl?

I am not an expert programmer

Это было полезно?

Решение 2

Something like this:

#!/usr/bin/perl
use strict;
use warnings;

use Archive::Zip;

my $archive_name = "archive.zip";

my $archive_extract = Archive::Zip -> new ( $archive_name );
foreach my $member ( $archive_extract -> members() )
{
  print $member -> fileName(),"\n";
}

You will, of course, need to supply your own directory search. I would recommend looking at File::Find for that

Другие советы

Archive::Zip can be used to read a zip file and it's members.

The module includes an examples directory that has a lot of useful scripts showing how to use the module.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top