Hello forum,
I am about to clean up the keywords of my image collection. I found keywords which are different only by upper case/lower case spelling:
motorbike.jpg
Keywords : technics, Repair,
engine.jpg
Keywords : Technics, repair, Engine
I would like to modify the keywords, so they are all lower case:
motorbike.jpg
Keywords : technics, repair
engine.jpg
Keywords : technics, repair, engine
As I am not yet so familiar with regular expression, I would appreciate the support of you very much.
Is there a solution with a single command line?
thanks in advance
Koala
exiftool -ver
10.16
Ubuntu 12.04
Hi Koala,
Try this:
exiftool -sep '//' '-keywords<${keywords;$_=lc}' DIR
Here I have used '//' for a separator to allow for the possibility for commas in some keywords.
- Phil
One reason I like using the API Filter option is that you don't always need to muck about with -Sep and worry about the contents of the data.
Here's my version.
exiftool -if "$keywords# ne $keywords" -api "Filter=$_=lc" -tagsfromfile @ -keywords FileOrDir
@StarGeek: Nice. Good idea.
@Koala: Use single quotes instead of double quotes because you are on Linux.
For those wondering about the difference, the interpolation of ${keywords} in the string concatenates list items using the specified separator, while copying by tag name only (-tagsfromfile @ -keywords) keeps them as individual items.
- Phil
Thanks for this great support.
I tested both version of command lines in a sample directory - both worked for me.
For the big run through my collection (> 18.000 images) I may use this version:
exiftool -if '$keywords# ne $keywords' -api "Filter=$_=lc' -tagsfromfile @ -keywords FileOrDir
best regards
Koala
to use it recursively you need -r
exiftool -r -if '$keywords# ne $keywords' -api 'Filter=$_=lc' -tagsfromfile @ -keywords Dir/
(also small typo corrected (" -> '))