Page 1 of 1

Sort Job Name Proper

Posted: Tue Nov 10, 2020 4:47 pm
by Liv
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!

Re: Sort Job Name Proper

Posted: Tue Nov 10, 2020 5:38 pm
by laurentd
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}$

Re: Sort Job Name Proper

Posted: Tue Nov 10, 2020 6:17 pm
by Liv
Thank you so much! I got it to work :D

Re: Sort Job Name Proper

Posted: Tue Nov 10, 2020 6:49 pm
by freddyp
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.

Re: Sort Job Name Proper

Posted: Tue Nov 17, 2020 5:06 pm
by Liv
Thank you Freddyp! I will look into this app too.