Page 1 of 1

Read input files in natural sort order?

Posted: Wed Apr 06, 2016 9:44 am
by cday
Pierre (or anyone else...) is there a way to read input files in natural sort order rather than the 'Windows' sort order?

When a multi-page file is created from files 1.tif 2.tif 3.tif ... 10.tif 11.tif ..., the pages are in the order 1, 10, 11...

Code: Select all

nconvert -out pdf -multi -o name.pdf *.tif
[When renumbering the files to 001.tif 002.tif 003.tif ... isn't an option.]

Re: Read input files in natural sort order?

Posted: Wed Apr 06, 2016 12:37 pm
by xnview
i don't know :(

Re: Read input files in natural sort order?

Posted: Wed Apr 06, 2016 2:13 pm
by Mixer
cday wrote:Pierre (or anyone else...) is there a way to read input files in natural sort order rather than the 'Windows' sort order?
If you had to sort strings "aaa", "aab", "aaab", "aac", "aaac", "aaad", "aad", "aaaa" in natural order, what order would it be?

Re: Read input files in natural sort order?

Posted: Wed Apr 06, 2016 2:24 pm
by cday
Mixer wrote:
cday wrote:Pierre (or anyone else...) is there a way to read input files in natural sort order rather than the 'Windows' sort order?
If you had to sort strings "aaa", "aab", "aaab", "aac", "aaac", "aaad", "aad", "aaaa" in natural order, what order would it be?
I'd have to think about that!

But the immediate problem only relates to reading numeric input files in natural numerical order, whereas NConvert (and cmd.exe generally seemingly...) reads them in the 'Windows' sort order: the result is that some pages in the multi-page PDF created are in the wrong order... :(

Renumbering the input files is the obvious solution, but RobertoG in his thread says he can't do that...

Re: Read input files in natural sort order?

Posted: Wed Apr 06, 2016 2:54 pm
by Mixer
With Explorer (just checked it in 10) you already have numeric sorting which you can revert to old-school http://superuser.com/questions/536438/w ... sort-order. With Nconvert I have no idea what it does and how it works.

Re: Read input files in natural sort order?

Posted: Wed Apr 06, 2016 4:07 pm
by cday
Mixer wrote:With Explorer (just checked it in 10) you already have numeric sorting which you can revert to old-school http://superuser.com/questions/536438/w ... sort-order. With Nconvert I have no idea what it does and how it works.
I suspect from a quick Google earlier that NConvert run using cmd.exe users cmd.exe sort order, which seems to be the 'Windows' 1, 10, 11 order.

Re: Read input files in natural sort order?

Posted: Thu Apr 07, 2016 11:47 am
by xnview
cday wrote:
Mixer wrote:With Explorer (just checked it in 10) you already have numeric sorting which you can revert to old-school http://superuser.com/questions/536438/w ... sort-order. With Nconvert I have no idea what it does and how it works.
I suspect from a quick Google earlier that NConvert run using cmd.exe users cmd.exe sort order, which seems to be the 'Windows' 1, 10, 11 order.
it's the arguments order from cmd

Re: Read input files in natural sort order?

Posted: Thu Apr 07, 2016 11:59 am
by cday
xnview wrote:it's the arguments order from cmd
And PowerShell seems to be the same, unless there's a switch for that?