appending a tag to a filename

Started by GoodKarma, June 02, 2023, 04:39:23 PM

Previous topic - Next topic

GoodKarma

Not used this in  while and having a brain fart, I am tryomg to appended xmp:sequence number to a folder, my command


exiftool '-FileName<${Filename}${XMP:SequenceNumber}' -ext jpg -r jpg

is appending the sequence number to the file extension, so

2023-05-22_11-47-05_Drone_1812_.jpg0 instead of 2023-05-22_11-47-05_Drone_1812_0.jpg

whta am i missing ?

StarGeek

The Filename tag includes the whole filename, including the extension.

Try using the percent variables detailed in the -w (-TextOut) option
exiftool '-FileName<%f${XMP:SequenceNumber}.%e' -ext jpg -r /path/to/files/

Or you could use the BaseName tag, but you would still need to deal with the file extension
exiftool '-FileName<${BaseName}${XMP:SequenceNumber}.%e' -ext jpg -r /path/to/files/
"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

GoodKarma

Quote from: StarGeek on June 04, 2023, 12:08:29 AMThe Filename tag includes the whole filename, including the extension.

Try using the percent variables detailed in the -w (-TextOut) option
exiftool '-FileName<%f${XMP:SequenceNumber}.%e' -ext jpg -r /path/to/files/

Or you could use the BaseName tag, but you would still need to deal with the file extension
exiftool '-FileName<${BaseName}${XMP:SequenceNumber}.%e' -ext jpg -r /path/to/files/

thank you so much Stargeek, the first option worked a treat