diff options
| author | pepper <peppersclothescult@gmail.com> | 2015-01-19 00:02:46 -0800 |
|---|---|---|
| committer | pepper <peppersclothescult@gmail.com> | 2015-01-19 00:02:46 -0800 |
| commit | 760d4d5a0fc89e5b14681879577a80e79795e4a3 (patch) | |
| tree | 3698995f434a00a904f9fdff64a739eb21f53fdb /midicsv-1.1/count_events.pl | |
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); + } |
