Sort Job Name Proper

Post Reply
User avatar
Liv
Member
Posts: 28
Joined: Tue May 12, 2020 10:54 pm
Location: Milwaukee, WI USA

Sort Job Name Proper

Post by Liv » Tue Nov 10, 2020 4:47 pm

I am trying to sort multiple pdf's using the Sort Files in Job. Here is my issue.

987654-1.pdf
987654-11.pdf
987654-14.pdf
987654-4.pdf
987654-9.pdf

I would like the pdfs to sort like this.

987654-1.pdf
987654-4.pdf
987654-9.pdf
987654-11.pdf
987654-14.pdf

Am I using the correct tool?
Thanks!

laurentd
Member
Posts: 36
Joined: Wed Mar 13, 2019 2:06 pm

Re: Sort Job Name Proper

Post by laurentd » Tue Nov 10, 2020 5:38 pm

The sorting is alphabetically correct, but of course you want to sort the files by number at the end.
You will have to add leading zeros.
Use a rename job element with these properties:
• Files inside job folder: Rename files
• Action 1: search and replace, search for -, replace by -00
• Action 2: search and replace, search for regular expression \d*$, replace by regular expression \d{3}$
Laurent De Wilde, Solution Architect @ Enfocus

User avatar
Liv
Member
Posts: 28
Joined: Tue May 12, 2020 10:54 pm
Location: Milwaukee, WI USA

Re: Sort Job Name Proper

Post by Liv » Tue Nov 10, 2020 6:17 pm

Thank you so much! I got it to work :D

freddyp
Advanced member
Posts: 574
Joined: Thu Feb 09, 2012 3:53 pm

Re: Sort Job Name Proper

Post by freddyp » Tue Nov 10, 2020 6:49 pm

Let me add something, just for the sake of education, because the approach Laurent described is much better in this case.

Your idea to use "Sort files in job" was essentially correct. If you had defined "Sort key 1" as "Number" and the "Number index" as 2, then all the files in the folder would have gotten a prefix so they were sorted in the correct order ... with the file names from your example. If the file names in another job could be

987655-now is the year 2020-1.pdf
987655-now is the year 2020-11.pdf

then you would have to set the "Number index" to 3, and with Laurent's solution it would still work.

And now that we are busy educating, there is one more tool you should be aware of and that is the "File Property Sort" app which is part of https://www.enfocus.com/en/appstore/product/folder-apps. It cannot solve your particular problem, but it is worth knowing it can sort in reverse order.

User avatar
Liv
Member
Posts: 28
Joined: Tue May 12, 2020 10:54 pm
Location: Milwaukee, WI USA

Re: Sort Job Name Proper

Post by Liv » Tue Nov 17, 2020 5:06 pm

Thank you Freddyp! I will look into this app too.

Post Reply