Delete raw (ARW) if JPG missing

Started by schmeel, April 11, 2020, 08:40:09 PM

Previous topic - Next topic

schmeel

I shoot RAW + JPG. My wife browses through the photos and deletes the throwaways. However, she only deletes the JPGs; the ARWs are left behind, and need to be deleted.

Anybody have a trick to use exiftool to identify (and delete or relocate) any ARW file that does NOT have a corresponding JPG in the same directory?

Thanks in advance to anyone who can help!

Phil Harvey

A sneaky trick like this should work:

exiftool -ext arw -directory=deleted -tagsfromfile %d%f.JPG -directory DIR

This will  move all ARW files which don't have a corresponding JPG from DIR to the "deleted" directory.

(If the JPG doesn't exist, then the directory falls back to the default of "deleted".  Otherwise it is moved to the same directory as it is already in... ie. it isn't moved)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Oh, that is very cool.  Adding that to my notes.
"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

schmeel

Thanks for the quick response - works great! Here's my final command:

exiftool -m -r -progress -ext arw -directory="$DESTDIR"/%-1:d -tagsfromfile %d%f.JPG -directory "$SOURCEDIR"

Phil Harvey

Great use of the %-1:d.  Well done.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).