A long time ago, when I got my first digital camera, I went ahead and renamed a couple of photos from their generic names, to meaningful names. While this improved readability in Windows Explorer, it messed up the file order, as I like to order the files in a directory as per their name. The name change caused photos taken at a later time of the day to appear before photos that were taken before them. While not a problem when all photos are of family or are portraits, it is not recommended when one goes for a tourist outing. Not only is it not possible to rename each file to a meaningful name, it also messes up the order, making it hard to recollect the sequence in which the photos were shot.
The DSLR is producing images starting with text ‘IMG_’. While this format is good till you hit a count of 9999 (which I am yet to do), there is a chance that the counter will start from 0000 once again. Earlier, renaming files was very easy, I only had to change the name of the directory (on the camera SD card), to have the camera start naming the files correctly.
As I am yet to get into that situation with the DSLR, I am making a wild guess regarding its behaviour. Hence I have written the following script to rename the ‘IMG_’ prefix to something that will help me preserve the order. As this is the first series of photos, the ‘IMG_’ prefix is replaced by the ‘C100_’ prefix. Once I reach the 9999 count, I simply need to change the ‘C100’ to ‘C101’ and so on to retain sequence . . . and sanity.
Windows script to rename image files
@echo off rem this script renames files that begin with IMG_ to CXXX_ cd C:\PHOTOS-ToArrange\ set NEW_PREFIX=C001 for /f "tokens=1* delims=_" %%i in ('dir /b IMG*.*') do ( echo renaming %%i_%%j as %NEW_PREFIX%_%%j ren %%i_%%j %NEW_PREFIX%_%%j ) cd .. rem echo Done pause
Windows script to rename movie files
@echo off rem this script renames files that begin with IMG_ to CXXX_ cd C:\PHOTOS-ToArrange set NEW_PREFIX=C001 for /f "tokens=1* delims=_" %%i in ('dir /b MVI*.*') do ( echo renaming %%i_%%j as %NEW_PREFIX%_%%j ren %%i_%%j %NEW_PREFIX%_%%j ) cd .. rem echo Done pause
- Renaming photo file names — https://twentymegahertz.wordpress.com/2016/05/14/renaming-photo-file-names/