문제

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