Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 551019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:20:59+00:00 2026-05-13T11:20:59+00:00

I am currently trying to process a bunch of files with imagemagick using a

  • 0

I am currently trying to process a bunch of files with imagemagick
using a batch file in windows, they are all numbered numerically as
follows:
image00
image01,
image02,
…,
image010,
image011,
…,
image0100,
image0101

and so on, but when i try to process the file it wants to run though
image00, image01, image010, image0100, image0101, image0102 and so on.

my code is as follows


SETLOCAL EnableDelayedExpansion
SET COUNT=0
FOR %%a in (*.bmp) DO
(
IF !ERRORLEVEL!==0
(
SET TFILE=0!COUNT!
SET TFILE=Terrain!TFILE:~-4!.jpg
SET /A COUNT+=1
ECHO %%a >output.txt
convert %%a -compress LOSSLESS !TFILE!
)
)

is there any way i can make it so that it will process these files in order, for the time being i have a work-around but it means that i continually have to change some script files when the images are used later on. I would much rather have all of the files be the same ‘Terrain’ name with incrementing number following.

Thanks in advance guys!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:20:59+00:00Added an answer on May 13, 2026 at 11:20 am

    you can probably create some more batch code to “sort” the numbers by order, however, since you can use imagemagick, i suppose you can also download other stuff. my suggestion is you can try and use GNU sort (in coreutils ). Then in your batch , do some thing like this

    pseudocode :

    for ... ( dir /b *bmp | gnu_sort -n ) do (
      echo "do your stuff"
    )
    

    you could probably check whether the sort that comes with Windows has a numerical sorting option. (the last time i check it doesn’t have this option).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to process a csv file in PHP using preg_match(). An
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
I'm currently trying to read in an XML file, make some minor changes (alter
I'm currently trying to optimize the sluggish process of retrieving a page of log
I'm trying to process a payment for a transaction. Currently I'm redirecting to a
I am currently trying to create a win32 service using pywin32. My main point
I am currently trying to import a list of executables from a text file
I am trying to process a dimension using SQL Server 2005 Analysis Services .
I am currently trying to setup our complete development process (from dev to production).
I am currently trying to print a message from a child process after calling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.