Delete JPG with same name as RAW files

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Delete JPG with same name as RAW files Wed Aug 26, 2020 9:48 pm • by Valet37
Hello, I've scoured the forums and can't figure out how to do this. I have a folder that contains both .JPG and .DNG (.dng is a RAW image format). Some of the files are identical images saved in both JPG and DNG formats these photos are named identically other than the file extension. For example:

However, sometimes when I shoot panoramas I do not get a .DNG file and only end up with a .JPG file.

    DJI_0001.DNG and DJI_0001.JPG are the same photo in different formats.
    DJI_0002.JPG is a panorama
    DJI_0003.DNG and DJI_0003.JPG are the same photo again

I'm trying to create an automation that scours my folder looking for all instances where the .JPG and .DNG files have the same name, and then delete the .JPG. So the desired result in the example above is to delete DJI_0001.JPG and DJI_0003.JPG and leave the rest.

Can anyone help?
Valet37
 
Posts: 2
Joined: Wed Aug 26, 2020 9:35 pm

Re: Delete JPG with same name as RAW files Thu Aug 27, 2020 10:37 am • by Mr_Noodle
You can use nested conditions (look them up in the manual) like so:
Code: Select all
   If (all) are met
       Name matches (•file name)
       Extension is JPG
          If (all) are met for (any file in the same folder)
              Name matches (•file name)
              Extension is DNG
   Do
       Move to Trash

(•file name) is a custom attribute which matches "anything". The first match will grab the file's name and store it into that custom attribute. The second match will require that the name matches the already captured value.

I suggest trying it on a test folder until you are confident that it is working as desired.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Delete JPG with same name as RAW files Thu Aug 27, 2020 7:49 pm • by Valet37
Worked perfectly, thank you! It's going to take me a while to get used to the logic tree.
Valet37
 
Posts: 2
Joined: Wed Aug 26, 2020 9:35 pm


Return to Support

cron