R
Ron Smith
#!/usr/bin/perl
use strict;
print "\n";
my %HoA;
for ( `dir /b/s` ) {
push @{ $HoA{$1} }, $2 if /(.+)\\(\w+)\.\d+\.\w+$/;
}
for my $dir ( sort keys %HoA ) {
print join ( "\n", $dir ), "\n\n";
my @basenames = @{ $HoA{$dir} };
my %count;
for my $frames ( @basenames ) {
$count{$frames} += 1;
}
for ( sort keys %count ) {
printf "%30s\t%04d\n", $_, $count{$_};
}
print "\n";
}
gives me:
file_base_name file_count
in two columns. How would I add additional columns like:
file_base_name file_count File_extension file_size
Which construct would I use? Would it be a 'HoH', or simply expand on
a 'HoA', or is it another construct like 'AoA' or AoH?
Any help would be appreciated.
TIA
Ron
use strict;
print "\n";
my %HoA;
for ( `dir /b/s` ) {
push @{ $HoA{$1} }, $2 if /(.+)\\(\w+)\.\d+\.\w+$/;
}
for my $dir ( sort keys %HoA ) {
print join ( "\n", $dir ), "\n\n";
my @basenames = @{ $HoA{$dir} };
my %count;
for my $frames ( @basenames ) {
$count{$frames} += 1;
}
for ( sort keys %count ) {
printf "%30s\t%04d\n", $_, $count{$_};
}
print "\n";
}
gives me:
file_base_name file_count
in two columns. How would I add additional columns like:
file_base_name file_count File_extension file_size
Which construct would I use? Would it be a 'HoH', or simply expand on
a 'HoA', or is it another construct like 'AoA' or AoH?
Any help would be appreciated.
TIA
Ron