I need a macro to group rows in 6 hierarchical levels like:

1
1.1
1.1.1
1.1.1.1
1.1.1.1.1
1.1.1.1.1.1
1.1.1.1.1.2
1.1.1.1.1.3
1.1.2
1.1.2.1
1.1.2.1.1
1.1.2.1.1.1
1.1.2.1.1.2

All my attempts didn't work really.
Any suggestions or tips are appreciated.

Thanks in anticipation.
jugeh