Batch set Tag value from file name

Started by rvicker, June 03, 2017, 01:48:04 PM

Previous topic - Next topic

rvicker

I would like to be able to set a couple of tags in JPG files (ImageDescription, Location) with some text plus the last four characters (sequence number) of the file name in batch mode.

Is there some variable that can be put in the variable column that will return the last 4 characters of the filename the way it can be used in creating an export file?

StarGeek

I don't use the GUI, so I can't really help with a solution there, but on the command line you could use ${Filename;s/.*(.{4})\..*/$1/} to grab the last 4 characters, dropping the extension, which I assume you want to do.
"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

rvicker

Thanks.

Unfortunately it doesn't work through the GUI. I get a tag filled in with the expression instead of the results of the expression.