#!/usr/bin/perl -w use strict; my $total = 0; my $category = ''; my $ininstrument = 0; my $incategory = 0; print "\n"; print "\n"; while (<>) { chomp; /^#/ and next; /=/ or next; my ($key, $value) = split /\s*=\s*/; if ($key eq 'category') { $ininstrument and print " \n"; $ininstrument = 0; $incategory and print " \n"; print " \n"; $incategory = 1; } elsif ($key eq 'name') { $ininstrument and print " \n"; $value =~ s/^"(.*)"\s*$/$1/; $ininstrument = 1; print " \n"; $total++; } elsif ($key eq 'clef') { print " \n"; } elsif ($key eq 'transposition') { print " \n"; } elsif ($key eq 'A lowest') { print " \n"; } else { # print " <$key>$value\n"; } } $ininstrument and print " \n"; $incategory and print " \n"; print "\n"; print "\n";