ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: stb62et on February 02, 2022, 06:30:50 AM

Title: Find out difference of 2 Tag-list and store the difference in a third Taglist
Post by: stb62et on February 02, 2022, 06:30:50 AM
Hello
I got 2 Tags (string/+) with similar meaning but diffent content.

XMP-acdsee:Keywords: TestAC1, TestAC2, TestAC3, TestP1, TestP2, TestP3
IPTC:Keywords: TestP1,TestAC1, TestP3, TestAC2

Now i want to know Wich Tags are in acdsee:Keywords but not in IPTC:Keywords. Until now i did not find a way to solve this .
Idea was to:
1. Copy Acdsee:Keywords to a third Taglist IPTC:By-line
exiftool IPTC:By-line<=XMP-acdsee:Keywords C:\Users\Stephan\Pictures\EXIFTEST5\IMG_0736.jpg

Tags after copy
C:\Program Files (x86)\exiftool-10.60>exiftool -XMP-acdsee:Keywords -IPTC:Keeywords -IPTC:By-line C:\Users\Stephan\Pictures\EXIFTEST5\IMG_0736.jpg
Keywords                        : TestAC2, TestP2, TestAC1, TestP1, TestP3, TestAC3
By-line                         : Test AC1, Test AC3, Test P1, Test P2

2. than delete the IPTC:Keywords from the IPTC:By-Line
exiftool -IPTC:By-line-=XMP-acdsee:Keywords C:\Users\Stephan\Pictures\EXIFTEST5\IMG_0736.jpg
This command does not change anything
    0 image files updated
    1 image files unchanged

3. The expected Result should be
IPTC:By-line: TestAC3, TestP3

Why is the second command line not working?
Is the approach the right one or do I better use a composite Tag?

thanks for your help
Stephan
Title: Re: Find out difference of 2 Tag-list and store the difference in a third Taglist
Post by: Phil Harvey on February 02, 2022, 07:51:30 AM
Hi Stephan,

Quote from: stb62et on February 02, 2022, 06:30:50 AM
2. than delete the IPTC:Keywords from the IPTC:By-Line
exiftool -IPTC:By-line-=XMP-acdsee:Keywords C:\Users\Stephan\Pictures\EXIFTEST5\IMG_0736.jpg

It should be -<, not -= (a-la common mistake 5c (https://exiftool.org/mistakes.html#M5)).

Your method is simpler than using a Composite tag, but requires more commands.

- Phil
Title: Re: Find out difference of 2 Tag-list and store the difference in a third Taglist
Post by: stb62et on February 02, 2022, 10:38:52 AM
Hi Phil
thanks a lot for your very fast help. This tool is more than gorgeous and helps a lot to normalize my tags in the pictures.
Athough i did a mistake in naming the tags your hint was right (as usual) and i apologize for this mistakes as you already have written a FAQ for this.

so to delete the command has to be

exiftool "-IPTC:By-line-<IPTC:Keywords" C:\Users\Stephan\Pictures\EXIFTEST5\IMG_0736.jpg

Is my assumption right that doing this in a composite Tag is performance wise faster than with 2 commands (I want to run this on severall thousands of jpgs´s).

thanks
Stephan
Title: Re: Find out difference of 2 Tag-list and store the difference in a third Taglist
Post by: Phil Harvey on February 04, 2022, 03:54:52 PM
Hi Stephan,

Yes, Doing this in a Composite tag should be at least twice as fast, but I don't have time to work up a config file that would do this.

- Phil
Title: Re: Find out difference of 2 Tag-list and store the difference in a third Taglist
Post by: stb62et on February 07, 2022, 05:22:36 AM
Hi Phil
again thanks for your fast reply.  :)
Stephan