Sort alphabetically

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Sort alphabetically

Post by snibgo »

The problem may be the drive "C:" in the file list. Try removing that, but ensure your current drive is "C:".
snibgo's IM pages: im.snibgo.com
gialandra
Posts: 11
Joined: 2019-02-10T00:32:33-07:00
Authentication code: 1152

Re: Sort alphabetically

Post by gialandra »

Now the name of items in myimages.txt are:
\1\PNG\2x0x0.png
\1\PNG\2x0x1.png
...

C:\1>magick montage -tile 7x -geometry +0+0 @myimages.txt "C:\1\col.png"
montage: unable to open image 'ÿþ\': No such file or directory @ error/blob.c/OpenBlob/3485.
montage: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.
montage: `C:\1\col.png' @ error/montage.c/MontageImageCommand/1777.

C:\1>
gialandra
Posts: 11
Joined: 2019-02-10T00:32:33-07:00
Authentication code: 1152

Re: Sort alphabetically

Post by gialandra »

Finally I found the right powershell line to list in naturally order and in digestible txt format (snibgo had guessed):

@(Get-ChildItem -path C:\...\*.png | Sort-Object { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) }).fullname |out-file -encoding ASCII c:\...\myimages.txt

Thank you
Post Reply