rename photo filenames recursively with copy number

Started by taw3210, October 12, 2016, 12:12:58 PM

Previous topic - Next topic

taw3210

I've read all of the documentation and can easily run a script to rename photos so that they are named by date/time. However, my photos are in hundreds of subfolders under a main Photos folder. The exiftool command does will append a copy id to any copies within the same folder, but when it moves to the next subfolder, it does not seem to work properly. In essence, what I am trying to achieve is to move all of my current photos that are in hundred of folders into new folders organized by yyyy-mm for date taken and also rename each file to yyyy-mm-dd hh-mm-ss. If the exif date/time is not in a file, it would be great to place those into an undated folder. Any help is appreciated.

Phil Harvey

#1
Quote from: taw3210 on October 12, 2016, 12:12:58 PM
The exiftool command does will append a copy id to any copies within the same folder, but when it moves to the next subfolder, it does not seem to work properly.

The %c format code will append a copy number for any file-name conflicts in the destination directory.  This isn't what you want?  I don't understand what you mean by "does not seem to work properly".

QuoteIf the exif date/time is not in a file, it would be great to place those into an undated folder. Any help is appreciated.

This is easy.  Simply specify a default FileName earlier on the command line.  For example:

exiftool -filename="/images/undated/%f%-c.%e" "-filename<datetimeoriginal" -d "/images/%Y-%m/%Y-%m-%d %H-%M-%S%%-c.%%e" -r DIR

- Phil

Edit: Fixed typos
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

taw3210

Phil, you are amazing! I'm the CEO of a software company serving Fortune 100 companies and Global 1000. Your responsiveness in supporting your freeware is better than many enterprise SaaS companies! This worked great. Once I finish this project, I will share my entire workflow and scripts on the forum. Thanks for your help and for providing such an amazing tool!