#!/usr/bin/perl -w
# auplabels - extract times of tracks in an Audacity file for adding labels
# caution - should be an XML parser, but works on plain text
# created by scruss on 02008/05/16

my %clips;
while (<>) {
    if (/<waveclip/) {    # contains clip time
        s/^\s+//;         # remove everything but the clip offset ...
        s/\s+$//;
        s/\s+/ /g;
        s/<waveclip offset="//;
        s/".*//;
        $clips{$_}++;     # store offsets uniquely
    }
}
foreach ( sort { $a <=> $b } ( keys(%clips) ) ) {
    print $_, "\t\n";
}
exit;

