Hi every exiftool's powerusers,
Since years i've been sorted my pictures in that way, a 'one level' directory structure, where these directories embeds keywords (separated by <space>):
<root_folder>/<keyword1 keyword2...>/file<1..n>.jpg
Today i would like to add those keywords (embedded in parent directory name) to my files with exiftool.
Do i need to write a script to parse recursively all my directories and affect tags or is it possible to get it on a single magical one-line with (the magical also) exiftool? In "such" a way
exiftool -sep " " -keywords-= "-keywords+=<parent directory name>" *.jpg
Thanks for any help or tip..
KR
To do this, you should first "cd" to the root folder, then apply this command:
exiftool -sep " " "-keywords+<directory" -ext jpg *
This is not what I would call recursive though, because it is a 1-level directory. To recurse into deeper levels, the -r option may be added, but in this case some formatting of the directory name would be required to prevent the path separator ("/") from messing up the keywords.
- Phil
Thank you so much Phil for your fast reply...and congratulations to have offered us such a power tool!
Best regards from France
Oh...i forgot to ask something
Can you confirm that
$ exiftool -sep " " -keywords-= "-keywords+<directory" -ext jpg *
will prevent files to be modified if they already have keywords?
Thanks in advance for any reply,
Best Regards
No. The -= is not a conditional deletion for list-type tags. It is used to delete individual keywords. Instead, use -if "not $keywords" (use single quotes instead if you are on Mac or Linux).
- Phil
Thank you so much.
...would perhaps be worth to appear in the FAQ, no?
Thanks again,
Best regards
Paul
Hi Paul,
This is the first time I can recall anyone having this problem.
- Phil