Solved

A batch script to rename a list of images.

Posted on 2011-02-15
5
346 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 48

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 54

Accepted Solution

by:
Bill Prew earned 500 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 54

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

761 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