Rick Quatro [[email protected]] wrote:

> I have a series of nested lists and am looking to sub sort each level in
> reverse order. Below is how the lists "look"; I have included a flat version
> and an indented version. Any advice on sorting algorithms would be
> appreciated.
> ....
> Before
> 1
> 2
> 3
> 3.1
> 3.2
> 3.3
> 3.3.1
> 3.3.2
> 3.3.3
> 3.3.3.1
> 3.3.3.2
> 3.3.3.3
> 3.3.3.3.1
> 3.3.3.3.2
> 4
> 4.1
> 4.2
> 5
> 
> After
> 5
> 4
> 4.2
> 4.1
> 3
> 3.3
> 3.3.3
> 3.3.3.3
> 3.3.3.3.2
> 3.3.3.3.1
> 3.3.3.2
> 3.3.3.1
> 3.3.2
> 3.3.1
> 3.2
> 3.1
> 2
> 1

Pad right with "Z":

1ZZZZZZZZ
2ZZZZZZZZ
3ZZZZZZZZ
3.1ZZZZZZ
3.2ZZZZZZ
3.3ZZZZZZ
3.3.1ZZZZ
3.3.2ZZZZ
3.3.3ZZZZ
3.3.3.1ZZ
3.3.3.2ZZ
3.3.3.3ZZ
3.3.3.3.1
3.3.3.3.2
4ZZZZZZZZ
4.1ZZZZZZ
4.2ZZZZZZ
5ZZZZZZZZ

Sort in descending order:

5ZZZZZZZZ
4ZZZZZZZZ
4.2ZZZZZZ
4.1ZZZZZZ
3ZZZZZZZZ
3.3ZZZZZZ
3.3.3ZZZZ
3.3.3.3ZZ
3.3.3.3.2
3.3.3.3.1
3.3.3.2ZZ
3.3.3.1ZZ
3.3.2ZZZZ
3.3.1ZZZZ
3.2ZZZZZZ
3.1ZZZZZZ
2ZZZZZZZZ
1ZZZZZZZZ

Remove the Zs:

5
4
4.2
4.1
3
3.3
3.3.3
3.3.3.3
3.3.3.3.2
3.3.3.3.1
3.3.3.2
3.3.3.1
3.3.2
3.3.1
3.2
3.1
2
1

-Andrew
_______________________________________________


You are currently subscribed to framers as [email protected].

Send list messages to [email protected].

To unsubscribe send a blank email to
[email protected]
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to [email protected]. Visit
http://www.frameusers.com/ for more resources and info.

Reply via email to