Sorting by date and removing duplicates

Started by jacorfe, March 24, 2016, 08:00:55 AM

Previous topic - Next topic

jacorfe

Hi All,

  I am trying to use Exiftool to rearrange my photos in to a directory structure of "YYYY/MM-DD/" keeping the original filename. The date of taking coupled with the filename is extremely likely to be unique.

This I can do using:

c:\exiftool.exe -k -r "-directory<filemodifydate" "-directory<createdate" "-directory<datetimeoriginal" -d "D://Sorted/%Y/%m-%d/" D:\Sorted\


...but I have multiple copies of photos spread around numerous drives. When a copy is found an error is produced and the copy left in a folder I wanted emptied.

Error: 'D://Sorted/2007/05-20/DSC_0280.JPG' already exists - D:/photos/Photos-1/104CERN_/DSC_0280.JPG

What I would like is for any copies ie for those files that already exist to either be copied over (brute force approach) or deleted so I end up with only one copy in the sorted folders, and the original folders empty.


Many thanks for your help.


Phil Harvey

Sorry, ExifTool won't overwrite or delete an image file.  This is for safety reasons.

You could run another command afterwards to move the duplicates to another directory, say -d "D://Duplicates/%Y/%m-%d/", then delete that directory yourself if you are sure they are in fact duplicates.

- 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 ($).