Help with simple Renaming

Started by nossaflex, July 03, 2022, 05:56:31 AM

Previous topic - Next topic

nossaflex

Still trying to get my head around the small intricacies of filenaming using ExifTool. Trying to get this output (on a Mac):

RACE1_OVERHEAD_FLEMINGTON_20220417

All of the relevant metadata has been put into the file. And this is what I'm using to try and rename:

exiftool '-filename<${scene}_${shotsize}_${location}_${createdate -d "%Y%m%d"}.%e'

The numbered section of the filename is just YYYYMMDD, but can't get this one to work. I know someone will be able to help!

Alan Clifford

You've got fancy quotes.  You need " "

StarGeek

Alan is correct.

See this post for some more details.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

nossaflex

Ahhh yes! I see. I removed the extra bit i had there because it was creating a directory instead of naming the file. So this works, but not getting the date in the format I was looking for.

Filename coming out like this:

RACE1_WIDE_FLEMINGTON_2022/06/23 02/06/50

How would I go about editing this command to just give me "20220623" as the date?:

exiftool '-filename<${scene}_${shotsize}_${location}_${createdate}.%e'

StarGeek

Use the -d (-dateFormat) option to globally change the formatting of the date.  The date codes can be found under Common Date Format Codes with examples higher up on that page.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

nossaflex

Thanks for the link! I figured out what I was doing wrong.

This is what I was trying to do:

exiftool '-filename<${scene}_${shotsize}_${location}_${createdate -d %Y%m%d}.%e'

But it kept making a new directory.

For anyone that doesn't know, the "-d" needs to be at the beginning, like this:

exiftool -d %Y%m%d '-filename<${scene}_${shotsize}_${location}_${createdate}.%e'

StarGeek

You were including the -d option in the filename.  It doesn't have to be at the beginning of the command, it can be anywhere on command line except between options that require a second parameter.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).