Sort Texts and Numbers

Hi! Wonder if there is anyone could help to sort the list with the combination of texts and numbers in 5 groups for every value. The Sort Text component does not work as it only follows the position order of the names but not the number sequences. Thanks!

Sort Text & Number.gh (5.8 KB)

Hi @Kent1

Do you mean this?


Sort Text & Number.gh (9.2 KB)

Hi Erik,

I only need 1 list, and it should follow the order in the vertical groups separated by β€œ_”, the front group will be prioritized than the latter ones.

And this is the order I need it to be:
L1_A11_EXT_03B_W3
L6_A01_EXT_02B_W2
L6_A04_INT_02B_W1
L30_A12_EXT_03B_W3
L61_A04_INT_02B_W60
L61_A04_INT_02B_W400
L200_A60_EXT_03B_W2
L200_A300_EXT_03B_W2
L401_A02_EXT_02B_W1

Thank you!

Not very elegant but done with the help of MultiSort from Pancake

Sort Text & Number.gh (13.8 KB)

2 Likes

The grave mistake here is that your numbers don’t have the same amount of digits.
If you can, add leading zeros and then Sort Text will be fine.

3 Likes

Yeah, thank you very much Keyu!

Yes, I also noticed that, but the issue is I dont know how many digits it is going to have before I make a standard series for the script, it may ends up having more than 3 digits instead of only 3 in this case.

ZeroPaddingSort.gh (14.6 KB)

2 Likes

Thank you very much Teddy, it works well!