Use only part of the lens name in the new name of an image

Started by twhite, August 30, 2017, 09:32:06 AM

Previous topic - Next topic

twhite

I would like to include the name of the lens in the image name. LensID tagt gives the full name that is a little too long.
LensID : Tamron AF 16-300mm f/3.5-6.3 Di II VC PZD (B016)

I would like to shorten it only to the text before the 'f/'.
How can I do this?

Thomas

StarGeek

I'm assuming you don't want to include the space in front of the "f/" as well.  If so, you can use this in the spot you want to use LensID:
${LensID;s/ f\/.*$//}
"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