Compare filenames without extension and mark it in the listers

I know the synchronize and the duplicate tool. But I have no solution for the following: I take fotos in RAW and JPG at the same time (Pentax DSLR). Then I have a folder "JPG" with the JPGs and delete all failed photos. Then I want to delete the belonging RAW files in the "RAW" folder. So I want to compare without extension and see, which files are only in one folder. These ones I want to mark and delete. Any suggestions?

Edit > Select Other > Select Source All to Destination (Ignore Extensions) can be used to do that.

That's in the Opsu 12 default toolbars. If you don't have it in your toolbars, the command it runs is this:

Select SOURCETODEST=in,noext DESELECTNOMATCH

So, with the JPG files on the left and the RAW files on the right, you can select all the JPG files and then use that menu item to select all the corresponding RAW files.

Then use Edit > Invert Selection on the right hand side so the selection is now all the RAW (or other) files that do not have a corresponding JPG file.


As an aside, this script may be useful as well, if you ever want to get the JPG and RAW files into the same places without worrying about where they are coming from: