I have a list of groups with contexts appended like so:
c_group.spo.cairns.qd
a_group.spo.cairns.qd
n_group.spo.cairns.qd
v1_group.inc.spo.cairns.qd
aa_group.inc.spo.cairns.qd
za_group.nda.mackay.qd
gb_group.nda.mackay.qd
aa_group.nda.mackay.qd
ab_group.inc.nda.mackay.qd
The group name is the first part before the first full stop eg. first one is c_group
The context is everything after the first full stop eg. first one is spo.cairns.qd
I need to sort the list so everything is grouped first alphabetically by context and then, within each of these groupings, alphabetically by the group name.
If I reverse everything then do a sort it sorts by context nicely, then reverse again to get list sorted by context. But then how to sort by group name inside that?
Any help greatly appreciated.
c_group.spo.cairns.qd
a_group.spo.cairns.qd
n_group.spo.cairns.qd
v1_group.inc.spo.cairns.qd
aa_group.inc.spo.cairns.qd
za_group.nda.mackay.qd
gb_group.nda.mackay.qd
aa_group.nda.mackay.qd
ab_group.inc.nda.mackay.qd
The group name is the first part before the first full stop eg. first one is c_group
The context is everything after the first full stop eg. first one is spo.cairns.qd
I need to sort the list so everything is grouped first alphabetically by context and then, within each of these groupings, alphabetically by the group name.
If I reverse everything then do a sort it sorts by context nicely, then reverse again to get list sorted by context. But then how to sort by group name inside that?
Any help greatly appreciated.