Link to home
Create AccountLog in
Avatar of ServalStudios
ServalStudios

asked on

Change filenames in a folder via batch

Is there a way to change all the filenames in a Windows folder easier than renaming each one?  Lets say I have a bunch of files that are 1000_300_001.jpg 1000_300_002.jpg etc.  I want to change the 300 to 330.  

I thought maybe that I go network in with a Mac and use the Linux terminal command somehow, but not sure. Any ideas for faster renaming?
Thanks
Avatar of amit_g
amit_g
Flag of United States of America image

for i in ????_300_???.jpg; do mv $i ${i/300/330}; done
Rename a Series of Files With IrfanView
http://graphicssoft.about.com/cs/renamers/ht/irfanviewrename.htm

Renamer (Win)
http://graphicssoft.about.com/od/findsoftware/p/renamer.htm

Just a few GUI tools as well....

Run this when you are in the directory with the files from the commandline:

for i in `ls 1000_300*.jpg`; do NEWNAME="`echo $i |sed 's/_300_/_330_/'`"; mv $i $NEWNAME; done
For that you need sh.exe from http://unxutils.sourceforge.net/
ASKER CERTIFIED SOLUTION
Avatar of ServalStudios
ServalStudios

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator