list sort by suffix/prefix

Discuss and share scripts and script files...
Post Reply
Redan13
Posts: 4
Joined: 20 Jun 2025 22:45

list sort by suffix/prefix

Post by Redan13 »

i find i often need to sort by a specific part of a name since duplicating a file adds a suffix ect. ex: example_0109.txt
i did a bit of searching and wast able to find a script or way to do this if anyone can be helpful with a soluton

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: list sort by suffix/prefix

Post by highend »

And now you want to sort by the part 0109?
One of my scripts helped you out? Please donate via Paypal

Redan13
Posts: 4
Joined: 20 Jun 2025 22:45

Re: list sort by suffix/prefix

Post by Redan13 »

correct.

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: list sort by suffix/prefix

Post by highend »

Add a scripted custom column and use e.g. this script (for this special case):

Code: Select all

return gettoken(<cc_base>, 2, "_");
Then you can use that column to sort
One of my scripts helped you out? Please donate via Paypal

Redan13
Posts: 4
Joined: 20 Jun 2025 22:45

Re: list sort by suffix/prefix

Post by Redan13 »

that helps thanks. but what about if it would be somthing like: example_111_0109-11.txt ; and still trying to sort by the 0109 segment?
Last edited by Redan13 on 05 Jul 2025 11:04, edited 1 time in total.

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: list sort by suffix/prefix

Post by highend »

Then you change to a more appropriate script:
return gettoken(gettoken(<cc_base>, 3, "_"), 1, "-");
One of my scripts helped you out? Please donate via Paypal

Redan13
Posts: 4
Joined: 20 Jun 2025 22:45

Re: list sort by suffix/prefix

Post by Redan13 »

that works thanks!

Post Reply