ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: neebah on August 14, 2016, 09:22:18 PM

Title: incrementing keyword tags
Post by: neebah on August 14, 2016, 09:22:18 PM
I would like to add an xmp:dc:subject tag for a group of photos by where they are stored in my house.  I would like to automatically increment them with the following

Scanned Binder #1 - 01
Scanned Binder #1 - 02
Scanned Binder #1 - 03
etc.. 

Any command for this. 
Title: Re: incrementing keyword tags
Post by: Phil Harvey on August 15, 2016, 07:48:58 AM
Yes.

exiftool "-subject+<Scanned Binder #1 - ${FileSequence;$_=sprintf('%.2d',$_+1)}" DIR

Here I have used the sprintf() to format the number as 2 digits and added 1 to start counting from 1.

- Phil
Title: Re: incrementing keyword tags
Post by: neebah on August 15, 2016, 11:45:56 AM
Thank you.  I just want to check.  Is this workable in Windows or Linux or both. 
Title: Re: incrementing keyword tags
Post by: Phil Harvey on August 15, 2016, 11:49:21 AM
The quotes are for Windows.  For Linux you must exchange the single and double quotes.

- Phil
Title: Re: incrementing keyword tags
Post by: neebah on September 10, 2016, 01:31:46 PM
What if I want the first number to start at 980
Title: Re: incrementing keyword tags
Post by: Phil Harvey on September 10, 2016, 09:02:24 PM
Replace "+1" in the sprintf() call with "+980".

- Phil