Find and delete jpgs with certain text in specific exif fields

Started by mmyiookp, April 24, 2021, 08:21:18 PM

Previous topic - Next topic

mmyiookp

I have tons of photos that I'm trying to purge out, and easiest way I can think of is by what's in the Description or Creator fields on the jpg files.

Is there a way to find all files that have a certain bit of text in the Description field and just delete those ones only from a directory recursively?

StarGeek

Exiftool can't delete the files, but you can use the -if option to list the files names or move them to a temporary folder to be deleted afterwards.

As an example,
exiftool -if "$Description=~/some text/" "-Directory=/path/ToBeDeleted/" /path/to/sourcesfiles/
would move any file that had "some text" (case sensitive) to the  "ToBeDeleted" directory.

One thing to watch for is the fact that there are multiple tags which could hold your "description" or "creator" values.
"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


StarGeek

"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