diff options
Diffstat (limited to 'midicsv-1.1/count_events.pl')
| -rw-r--r-- | midicsv-1.1/count_events.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/midicsv-1.1/count_events.pl b/midicsv-1.1/count_events.pl new file mode 100644 index 0000000..377dcd4 --- /dev/null +++ b/midicsv-1.1/count_events.pl @@ -0,0 +1,18 @@ + + # Count number of events by type in CSV MIDI file + # and report. + + while ($a = <>) { + + if (!($a =~ m/\s*[\#\;]/)) { # Ignore comment lines + if ($a =~ m/\d+\s*,\s*\d+\s*,\s*(\w+)/) { + $events{$1}++; + } else { + print("Cannot parse: $a"); + } + } + } + + foreach $k (sort(keys(%events))) { + printf("%9d %s\n", $events{$k}, $k); + } |
