ExifTool Forum

General => Metadata => Topic started by: j99mac on April 29, 2020, 01:35:03 PM

Title: renaming files by CreateDate
Post by: j99mac on April 29, 2020, 01:35:03 PM
I am trying to rename files my CreateDate_model_01

When I run the command it dose not run. what do I need to change to make it run "$input_variable?
Also how to ad a one up number at the end?

exiftool -d '%Y%m%d' '-FileName<${CreateDate;}_${Model;}%-c.%e' "$input_variable"
Title: Re: renaming files by CreateDate
Post by: Phil Harvey on April 29, 2020, 01:39:02 PM
I assume you are on Mac or Linux.  (probably mac due to your user name)

How are you assigning the "input_variable"?

Do you always want the number at the end?  Always 2 digits?  What exactly do you want the number to signify?  You might try something like "-%.2nc".

- Phil
Title: Re: renaming files by CreateDate
Post by: j99mac on April 29, 2020, 01:42:39 PM
Yes on a Mac

This is my full command

echo "Enter the file path of Images"
   read input_variable
exiftool -d '%Y%m%d' '-FileName<${CreateDate;}_${Model;}-%.2nc' "$input_variable

I added -%.2nc
Title: Re: renaming files by CreateDate
Post by: Phil Harvey on April 29, 2020, 01:59:22 PM
You forgot the closing double quote.  But with that, the script should work (but you should add ".%e" to the end of the fie name).  You can test out the passing of variables using the exiftool -echo option if you need to troubleshoot this.

- Phil