Sort numbers in ascending order with Regex
-
good day, did anyone know how to sort numbers in ascending order with Regex?
foe example:
5097 5794 5531 2235 2234 1234 1233
after using regex this must be the output:
1233 1234 2234 2235 5097 5531 5794
-
Why do you want to use “regex”? Regex doesn’t know about “sorting” or about values of numbers, so it is a tough task.
Have you tried Edit (menu) > Line Operations > Sort Lines As Integers Ascending ??
-
hello. nice. I didn’t know this task on notepad++. Thanks ;)
-
anyway, it would have been useful in regex, though, especially if I have multiple tables similar in multiple files. it is difficult to modify each one individually.
-
@Bebee-Bebrto said in Sort numbers in ascending order with Regex:
it would have been useful in regex, though, especially if I have multiple tables similar in multiple files. it is difficult to modify each one individually.
Well, for that scenario I probably would write an external program to do it and not bother with Notepad++ at all.
-
the idea, maybe, is to make all Edit Options to make replacement in all files, not just in one file.