Page 1 of 1
Sort alpha & numeric
Posted: 04.01.2024 02:41
by BBServ
Is there a way to sort numbers mixed with text and keep the numbers in proper order? I can do this with Notepad++.
Example Text sorted as desired:
a1
a2
a5
a9
a12
a44
With Cuda I get:
a1
a12
a2
a44
a5
a9
Re: Sort alpha & numeric
Posted: 04.01.2024 06:05
by main Alexey
There is a way.
Call "Plugins / Sort / Sort dialog" (plugin).
In that dialog
- check "Numeric"
- change "Sort only by substring / From" to 1
'From'=1 because we have one 'a' letter at start.
If you have 'aaa' at start, then 'From' must be 3.
Re: Sort alpha & numeric
Posted: 04.01.2024 06:36
by main Alexey
I made change to 'Sort' plugin. you can download / replace files from
https://github.com/Alexey-T/CudaText/tr ... /cuda_sort
change is:
+ add: plugin Sort: 'Numeric' option handles leading letters too, e.g. line 'before123after' will be treated as tuple ('before', 123, 'after')
so, for your text, you don't need to set 'From'/'To' anymore. only check the 'Numeric' option.
Re: Sort alpha & numeric
Posted: 04.01.2024 15:45
by BBServ
Works perfectly - thanks