Re: Delete keywords that contain specific string

Started by ne17, March 15, 2022, 02:44:19 PM

Previous topic - Next topic

ne17

Windows 10 Command line exiftool 12.40
Please can I confirm that

exiftool "-XMP-photoshop:Headline-=~/^\s+$$/" -r .

is not supported?

I'm using an Adobe Bridge Smart Collection to display all images with a Headline present in the metadata - and it turns out some of my images had an empty headline - I can delete those with

exiftool -XMP-photoshop:Headline-= -r .


but for reasons of past editing some images have one or more spaces - and I'd like to delete those tags ideally without using

exiftool -if "($XMP-Photoshop:Headline=~/^\s+$$/)" -XMP-Photoshop:Headline= -r .


as each pass through all of my images takes about 1.5 days...

I did experiment with

exiftool -api "Filter=s/^\s+$$//" -XMP-Photoshop:Headline-='' -r .

but that didn't remove the tags on images with spaces.

StarGeek

Split into separate thread.

No, you can't use regex with the -TAG-= option.  See the docs on the -TAG[+-^]=[VALUE] option.

The third command you give (-if "($XMP-Photoshop:Headline=~/^\s+$$/)") would be the one to use.  And if it's taking such a long time, then something else must be happening.  Using that command shouldn't be any slower than -TAG-=
* 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).

ne17

Thanks for the confirmation - I had read the documentation but as it didn't explicity mention -=~ not being valid I thought it worth trying.
I also hoped -=$anothertag might also work - and was again left ...

a -fast2 pass of reading through all of my images takes 1.5 days & if I include a specific -if clause then I can't do anything else in that pass.

Hence my aim to avoid -if if I can (using advanced formatting and any other trick I might spot) to get several updates doe in a single pass.

StarGeek

Quote from: ne17 on March 15, 2022, 06:28:12 PM
I also hoped -=$anothertag might also work - and was again left ...

See Common Mistake #5c

Example:
C:\>exiftool -G1 -a -s -Description -Caption-Abstract y:\!temp\Test4.jpg
[XMP-dc]        Description                     : Test
[IPTC]          Caption-Abstract                : Test

C:\>exiftool -P -overwrite_original "-Description-<Caption-Abstract" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Description -Caption-Abstract y:\!temp\Test4.jpg
[IPTC]          Caption-Abstract                : Test


But I don't see how that would help.
* 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).

ne17

Many thanks Stargeek!
flagging up 5c made me reread the section and realise I have made mistake 5b (putting a $ in front of all of my tags on the right hand side) for the past n years.
I will cautiously remove them from all my stored 'macros'

For my first couple of years use of exiftool I was confused between = and < but now only if I haven't created / altered anything new for a while!

Nigel