replace / add table (keywords)

Started by audiogalaxy, December 02, 2020, 02:39:24 AM

Previous topic - Next topic

audiogalaxy

Hallo, I was wandering for some great trick by Phil (or some very experienced user!) to create some "conversion / add tables" to work on keywords (or keywords-like fields) as I'm trying to explain as follows:

WAY 1) search and replace keyword : given the keyword "red" (if found) in the keyword (subject...) field among other keywords, it has to be replaced with <something>
examples for <something> = rouge /// red color /// green /// red led  /// red lights /// carta

WAY 2) search keyword, ADD a list of keywords: given the word "apple" (if found) it must be added a list of the following keywords: red, yellow, green, vegetable, food and drink, healthy food ... ... and so on.

this with LISTS of add/replacements

so that I could replace a list of the same things with some other things in my "dictionaries"

A list of keywords related to people, another to abstract concepts, another with typical orthographic errors...

(is there a chance to have another way to correct orthographical errors "automatically"?)

Thanks to everyone trying to think about this... but MANY thanks to everyone trying to SOLVE this!!!!!!!  :D ;D
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

Phil Harvey

You will find it is tricky to do this properly.  You can't just replace "red" with "green" for example.  What happens if a keyword is "reduction", or "Red Barn"?

If you can figure out how to handle all cases like this, then the best way to do this is with a user-defined tag in a config file.  This can certainly be done, but I don't have the time right now or enough details to be able to do this for you.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Try the config file in this post.  Given a keyword in the DATA section, it will be replaced by all the keywords that follow it.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

audiogalaxy

Quote from: StarGeek on December 02, 2020, 10:41:01 AM
Try the config file in this post.  Given a keyword in the DATA section, it will be replaced by all the keywords that follow it.

Thanks Star! I'll give a try!
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline