Sort and number files in reverse order

Post Reply
User avatar
billy.olvestad
Member
Posts: 51
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

Sort and number files in reverse order

Post by billy.olvestad »

We have a customer that gets files for output, where they have to merge hundreds of pdf-files to one in backwards date order.
That is, the first pdf has to be the one with the latest creation date, and the last has to be the one with the oldest creation date.

I have tried the "sort files in job", and have managed to get it to number the files with a prefix, but I can't seem to get reverse order (descending).
I need a prefix in reverse order as I understand it to get the correct order when merging the pdf-files.

I am fresh out of ideas. Does anyone have any suggestions how to accomplish this?
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Sort and number files in reverse order

Post by Padawan »

I assume you can get the ascending number out of the filename using a variable?

Then you can use the calculation variable to do 10000 minus the ascending number. The resulting number will be descending and can be used to rename the file.

It doesn't have to be 10000, but it needs to be a number which will certainly be bigger then all the existing numbers.
User avatar
billy.olvestad
Member
Posts: 51
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

Re: Sort and number files in reverse order

Post by billy.olvestad »

Thanks for the tip. That was more simple than I imagined :D
User avatar
billy.olvestad
Member
Posts: 51
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

Re: Sort and number files in reverse order

Post by billy.olvestad »

Thanks for the tip. That was more simple than I imagined :D
Post Reply