Search tags for words and add to keywords

Started by magarlick, July 03, 2022, 02:18:41 PM

Previous topic - Next topic

magarlick

Dear all

Is there any way to search specific tags (e.g. TransmissionReference or OriginalTransmissionReference or Instructions) for a certain word and, if the word is found in a given file, append it to the keywords for that file?

Linux Mint, latest exiftool.

Thanks.

StarGeek

Do you need to extract a specific word from the tag or just add the full tag value to the keyword?

In the latter case, the command would be something like
exiftool -if "$TransmissionReference=~/word/i" "-Subject+<TransmissionReference" /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

magarlick

Thank you, that's helpful. It would be good to only extract part of the word from the tag. 'If the tag TransmissionReference contains Cambridge University Press, add Cambridge to the keywords'.

Phil Harvey

Quote from: magarlick on July 03, 2022, 03:45:53 PM
It would be good to only extract part of the word from the tag. 'If the tag TransmissionReference contains Cambridge University Press, add Cambridge to the keywords'.

exiftool -if "$TransmissionReference=~/Cambridge University Press/" "-Subject+=Cambridge" DIR

- Phil
...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 ($).

StarGeek

Dang it.  I typed the exact same thing, but I guess I got distracted and never actually hit Post.
"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