ExifTool Forum

ExifTool => Newbies => Topic started by: OOmatrixOO on July 18, 2017, 03:14:54 PM

Title: -filename<$DateTimeOriginal rename problem
Post by: OOmatrixOO on July 18, 2017, 03:14:54 PM
Hello.
I use this to rename my photos. And it work.
exiftool -o "Bearbeitet/" -fileOrder DateTimeOriginal "-filename=#%%1.3C.%%le" "-filename<$DateTimeOriginal %%1.3C.%%le" -d %%Y-%%m-%%d -ext jpg

But if i set a underscore after $DateTimeOriginal, it doesnt work anymore.
exiftool -o "Bearbeitet/" -fileOrder DateTimeOriginal "-filename=#%%1.3C.%%le" "-filename<$DateTimeOriginal_%%1.3C.%%le" -d %%Y-%%m-%%d -ext jpg

What can I do to make this work?

Thanks.
Title: Re: -filename<$DateTimeOriginal rename problem
Post by: StarGeek on July 18, 2017, 03:24:20 PM
Because you're adding characters directly onto the end of the tag name, the tag names needs to be separated from the rest of the command.  You can use brace { } characters to do this (see the docs under the -p option (http://www.exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat)).  So try this as your command:

exiftool -o "Bearbeitet/" -fileOrder DateTimeOriginal "-filename=#%%1.3C.%%le" "-filename<${DateTimeOriginal}_%%1.3C.%%le" -d %%Y-%%m-%%d -ext jpg