Group & sort text by branch

Apologies for asking a simple one, but after a good amount of experimentation an elegant solution using default GH components eludes me, and in fact I don’t have a functional one at all.

I’m seeking to split up multiline text by specific strings, sort by those strings, regroup and branch for downstream uses. Imagine this is a list of staff in an office.

GH file attached below (with all the inelegant and ineffective experiments deleted).

Thanks for looking.
TextListCustomSort.gh (7.9 KB)

Try the Flip Matrix component

To take it a step further and group by group.

Re_TextListCustomSort.gh (15.1 KB)

1 Like

Exactly - I never thought to create a list of indexes for each occurrence of a single value. Sounds obvious and was. Thank you very much!