Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

A batch script to rename a list of images.

Posted on 2011-02-15
5
Medium Priority
?
378 Views
Last Modified: 2012-05-11
Hello,

read here to be able to understand the previous episodes :

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_26789497.html

I'm trying to export a list of images from a video,from a starting frame number to an ending frame number. In the screenshot I wanted to start exporting images from br7429.jpg to br7478.jpg. I haven't understood how to do it with VirtualDub. Do you know a way to do it ? If this is not possible,I would like to use VirtualDUB to export images from br0.jpg to br (ending number).jpg and then a batch script to rename all the pictures from br0.jpg / br (ending number).jpg to br7429.jpg to br7478.jpg (in this specific situation).
15-02-2011-23-01-54.jpg
0
Comment
Question by:marietto2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 49

Expert Comment

by:dbrunton
ID: 34906311
I've just taken a a look at VirtualDub.

You will have to take the second option.  If you change the Minimum number of digits you will get the numbering starting from 0 and going up to your ending number.

You will then need one of the scripting wizards to make you a batch file to do the converting to the number range you want.

However it might be better for the scripting wizards to leave the Minimum number of digits at 4 so you will end up with the first file as br0000.jpg but the name lengths will be consistent for easy manipulation.
0
 
LVL 58

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 34920640
Give this a try, I think it's what you are after.  Notice the REN has ECHO before it right now, for debugging.  It will just echo the REN command that would be executed.  See if this gives the results you need, and if so remove the ECHO.

@echo off
setlocal EnableDelayedExpansion
call :Offset 100 1000
exit /b

:Offset [ending-current-number] [offset-amount]
  for /L %%A in (%~1, -1, 0) do (
    set /A NewNum=%%A + %~2
    echo ren "br%%A.jpg" "br!NewNum!.jpg"
  )
  exit /b

Open in new window

~bp
0
 
LVL 2

Author Closing Comment

by:marietto2008
ID: 34945370
yes,billprew is a good coder.
0
 
LVL 58

Expert Comment

by:Bill Prew
ID: 34947714
Thanks so much, glad that helped.

~bp
0
 
LVL 2

Author Comment

by:marietto2008
ID: 34947727
Really I haven't tried your code,but I know what it may works without problems. Here I was using an old tecnique to make an animation,now I'm trying to use more sophisticated tecniques.

0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question