Hi.
 
> I am unable to get the attachment (I get http error 404). What am I missing?

A possible explanation was given in another post.
In any case, here is the script inline (just copy/paste the text between
the "---CUT---" marks in another file):

---CUT---
#!/usr/bin/perl -w

use IO::File;

my $lilyRE = '\b([a-gs](is|es){0,2})(\d|\b)';

my %counters = ();

for my $f (@ARGV) {
    my $io = IO::File->new($f);

    while ($_ = $io->getline) {
        chomp;

        my $note;
        while (($note) = /$lilyRE/o) {
            s/^.*?$note//;
            $counters{$note}++;
        }
    }
}
my $total = 0;

foreach (keys %counters) {
    $total += $counters{$_};
}

my %percent = ();

foreach (keys %counters) {
    $percent{$_} = $counters{$_} / $total * 100;
}

foreach (keys %counters) {
    print $_, '=', $counters{$_}, ' (';
    printf "%.2f", $percent{$_};
    print '%)', "\n" ;
}

print "Total=$total\n";
---CUT---


Best,
Gilles


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to