Renaming Files based on DateTimeOriginal and a custom text

Started by irinaonline, June 15, 2017, 05:34:04 PM

Previous topic - Next topic

irinaonline

"-FileName<EXIF:DateTimeOriginal TEST" does not seem to work. What is the syntax to just add a custom text to the filename?

Phil Harvey

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

irinaonline

thanks. worked. but with "-FileName<$EXIF:DateTimeOriginal 0WL1" "%%Y%%m%%d %%H%%M%%S%%%%-c.%%%%ue" he swallowed my extension now

StarGeek

Move the Count and Extension variables out of the date format and into the rename part.  The percent signs only need to be doubled once in there:
exiftool  "-FileName<$EXIF:DateTimeOriginal 0WL1%%-c.%%ue" -d "%%Y%%m%%d %%H%%M%%S"

Example (not from bat file, so % not doubled)
C:\>exiftool "-testname<$EXIF:DateTimeOriginal 0WL1%-c.%ue" -d "%Y%m%d %H%M%S" X:\!temp\Test3.jpg
'X:/!temp/Test3.jpg' --> 'X:/!temp/20151212 121212 0WL1.JPG'
    0 image files updated
    1 image files unchanged
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype


alexy frangieh

great evening doctor,
please, i have a tree structure containing about 150.000 photos in a sequence (same camera)
i need to rename the whole in the following format ProjectXXXXXX where XXXXXX is the unique value of the -shuttercount exif extract

please can you provide me with a full syntax, including any eventual -r or a file overwrite

much appreciated sir

Hayo Baan

The following command would rename all files in DIR (and below) that have a shutter count to Projectxxxx.

exiftool -if '$ShutterCount' '-FileName<Project$ShutterCount.%e' -r DIR
But that would result in file names with different lengths. If you'd like all the shutter counts to have the same number of digits (e.g. 6), use this:
exiftool -if '$ShutterCount' '-FileName<${ShutterCount; $_ = substr("000000$_",-6);}.%e' -r DIR

Note: test this out on a small number of files first, of course...
Hayo Baan – Photography
Web: www.hayobaan.nl