Replacing/Deleting parts of keywords

Started by afx, May 11, 2014, 05:09:24 PM

Previous topic - Next topic

afx

Hi,
I have a few hundred files where the keywords are messed up because I wrote iMatch3 categories as hierarchical keywords into them.
So I have things like "IPTC|Keywords|baboon" in my keywords.
Is there an easy way to do a find/replace to get rid of "IPTC|Keywords|" in all selected files?
I want to keep the last bit....

EDIT: The only way I can think of right now is have iMatch generate a list of files and then run a shell script with some exiftool extraction, sed mangling and then exiftool writeback. Does not sound enticing....

thx
afx

Mario

QuoteIs there an easy way to do a find/replace to get rid of "IPTC|Keywords|" in all selected files?

Your example is to unspecific to be answered in a helpful way.
You are not given me enough details to work with, sorry.

IPTC|Keywords looks like the start of a hierarchical keyword, right? Something like

IPTC|Keywords|Duck

If you select the category corresponding to this keyword,

@Keywords
|- IPTC
  |- Duck


you see all files with that keyword. Select them with <Ctrl>+<A>, remove the IPTC|Keyword|Duck keyword and add "Duck" only in the Keyword Panel. This replaces all hierarchical keywords with a flat keyword in all selected files. Alternatively, drag (move) the files from the hierarchical keyword category to a flat keyword category in the category view.

If you have created dozens or hundreds of unwanted hierarchical keywords, this will take a while. You can use an IMatch script of course to process the keywords in your files in any thinkable way.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

Quote from: Mario on May 11, 2014, 06:35:01 PM
QuoteIs there an easy way to do a find/replace to get rid of "IPTC|Keywords|" in all selected files?

Your example is to unspecific to be answered in a helpful way.
You are not given me enough details to work with, sorry.
The keyword was "a few hundred files" above. Sorry if that was not clear enough.

What you describe works, I started that way and quickly gave up. With a few hundreds files with various keywords it becomes a bit cumbersome to say the least ;-(

QuoteIf you have created dozens or hundreds of unwanted hierarchical keywords, this will take a while. You can use an IMatch script of course to process the keywords in your files in any thinkable way.
Yup, I was hoping some keyword mangling script already exists to use as a base. Did not find one in the forum or the samples, but maybe I am looking at the wrong place.

cheers
afx

Mario

I'm not aware of such a script. Your problem is not that common. Most people rather want to make their keywords hierarchical instead of removing the hierarchies...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

Quote from: Mario on May 11, 2014, 08:16:47 PM
I'm not aware of such a script. Your problem is not that common. Most people rather want to make their keywords hierarchical instead of removing the hierarchies...
;-)

I love hierarchical categories. But keywords? Does not make sense as that stuff gets exported when files are passed on and none of my destinations want or can handle hierarchical keywords.
And my experience with hierarchical categories shows that hierarchies are a PITA to maintain properly compared to keywords.
Nowadays I only use hierarchical stuff to trace the workflow and for my internal meta information. But to properly attribute images I feel plain keywords work much better.

Is there any keyword manipulation script I could use as a base?

thx
afx

Mario

QuoteDoes not make sense as that stuff gets exported when files are passed on and none of my destinations want or can handle hierarchical keywords.

IMatch works with hierarchical keywords internally.
XMP and IPTC keywords are "flat" and you can control how IMatch flattens your hierarchical keywords when updating your files.
The @Keywords mirrors hierarchical keywords automatically so you have the best of both worlds.

Whether you use this or not depends entirely on your preferences.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook