Specify tags to keep, but remove all else

Started by sdubay, July 17, 2020, 12:17:26 PM

Previous topic - Next topic

sdubay

Apologies if this information is outlined somewhere already, but I haven't found it. I am very new to this and may not use the correct lingo...  :-[

I have been using the following code to delete specified tags (in this example, "UserComment") from a batch of many thousands of images, and it has been working well:
exiftool -r -m -overwrite_original -UserComment= \location\of\images

However, instead of specifying the tags to delete, I would like to specify a list of tags to keep and delete all others.
This line will be used on large datasets with images from various cameras, therefore it's easier to specify the tags I am interested in and delete any others, versus try to anticipate all tags that may be encountered and need to be removed.

StarGeek

The command would be along these lines
exiftool -all= -TagsFromFile @ -TAGTOKEEP1 -TAGTOKEEP2 /path/to/files/

You should be very careful with a command like that.  It absolutely should not be run on a RAW file of any type.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype