Here's a quick one-off, let me know if it does what you want (it might not,
I didn't check it much).

Karl Runge


--------------------------------------------------------------------------
#!/usr/bin/perl

# Usage: bookmarksort <bookmarkfile>
# Prints netscape bookmarkfile to STDOUT with subsections sorted.

while (<>) {
        if ( ! /<DT>.*HREF/ ) {
                print sort labelsort @list;
                @list = ();
                print;
        } else {
                push(@list, $_);
        }
}

sub labelsort {
        my $A = $a;
        my $B = $b;
        $A =~ s/<[^>]*>//g;     # remove HTML tags.
        $B =~ s/<[^>]*>//g;
        $A =~ s/^\s*//;         # remove leading spaces.
        $B =~ s/^\s*//;

        $A cmp $B;
}


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to