ExifTool Forum

ExifTool => Newbies => Topic started by: millerstevew on August 09, 2013, 06:55:03 PM

Title: Renaming photos with a copy number
Post by: millerstevew on August 09, 2013, 06:55:03 PM
I would like to rename my photos with a copy number that begins at one and omits the copy number when there are no duplicates. I can successfully introduce a copy number that starts at one with the following command, which I discovered here https://exiftool.org/forum/index.php?topic=4660.0 (https://exiftool.org/forum/index.php?topic=4660.0):

exiftool '-FileName<datetimeoriginal' -d "%Y-%m-%d %H.%M.%S%%-.2nc.%%le" FILE

I know that exiftool omits copy numbers when beginning at zero, which I found here http://www.exiftool.org/exiftool_pod.html (http://www.exiftool.org/exiftool_pod.html) under copy number. Is it possible to omit the copy number when beginning with one?

Thanks for the help,
Steve Miller
Title: Re: Renaming photos with a copy number
Post by: Phil Harvey on August 09, 2013, 10:21:58 PM
Hi Steve,

I'm not clear exactly what you want.  Is it like this?:

XXX.jpg
XXX-02.jpg
XXX-03.jpg

?

If so, just drop the "." to give %%-2nc

- Phil
Title: Re: Renaming photos with a copy number
Post by: millerstevew on August 10, 2013, 12:09:53 AM
I want the files to look like this:

aaa.jpg
bbb.jpg
ccc.jpg
ddd-01.jpg
ddd-02.jpg
ddd-03.jpg
eee.jpg

My file naming convention is "YYYY-MM-DD HH.MM.SS", and I want to use the copy number when there are date/time collisions.

- Steve
Title: Re: Renaming photos with a copy number
Post by: Phil Harvey on August 10, 2013, 08:58:49 AM
Hi Steve,

Ah.  Bummer.  Not possible.  Unfortunately, ExifTool can not look into the future to see if there will be more files named "ddd.jpg", so it has no way to tell if the "-01" should be added when it names this file. (ExifTool does things in a single pass for efficiency.)

- Phil