Compare two folders contents by filename
Hi, felows!
Is there any convenient way to compare two folders contents by filename?
(I miss DOS Navigator so bad...)
iMac 27″ 5K, macOS 12.1
Hi, felows!
Is there any convenient way to compare two folders contents by filename?
(I miss DOS Navigator so bad...)
iMac 27″ 5K, macOS 12.1
I always use "diff -r --brief --exclude=.git /path/to/folder1 /path/to/folder2" in the Terminal.
I'm sure there are plenty of GUI options too.
Alejandro_64 wrote:
(Makes me mad that in FAR Manager in Windows this is done in 2 minutes with "File Compare" dialog. Yet, in macOS I already spent 2 days to find solution and didnt find yet.)
Is it that bad? 2 days, eh?
Well, I have never heard for FAR Manager, so I googled it. It isn't part of Windows. It is a 3rd party app. And there is a Mac version. So what exactly where you looking for?
Of course you know, when you say something that, it is a rule that one has to take the subject of your question and put it into a Google search. The top, and repeated hit, was my own suggestion to use "diff". Some other great suggestions are Beyond Compare (another Windows app that also has a Mac version, Diffmerge (ditto), Kaleidoscope (a Mac-only app).
"Just manually go though and delete any duplicate images. It is tedious, but easy enough."
12000 duplicates. Makes manual ceanup a bit tricky.
Does one folder exclusively contain {jpg, jpeg} images and the other folder contain just {heic} images? Flat folders, or a folder hierarchy of sub-folders in each main folder?
I have a working Ruby script that when supplied with the two folders, compares image basenames between the two folders (no hierarchy) and writes a report of those matching file basenames to the Desktop. On completion, it presents an AppleScript dialog that tells how many files matched and the elapsed processing time.
Is this something you are interested in?
Wouldn't help. Have 12000 files JPEG and HEIC to compare and select the ones that have matching names.
(Makes me mad that in FAR Manager in Windows this is done in 2 minutes with "File Compare" dialog. Yet, in macOS I already spent 2 days to find solution and didnt find yet.)
3 days now.
Would you be so kind to provide direct link to FAR manager for macOS? Don't see it.
To be more specific: Connection of iCloud+ duplicated most of my JPEG photos in iMac Photo Library (acquired via Photo Stream - that's why they are in JPEG) with their original, HEIC, originals on iPhone. Merged 2 libraries in one.
Primary problem is: Get rig of JPEG duplicates of HEIC photos. Duplicates have identical filenames but different extensions. Photos doesn't provide means to compare two smart folders - so I have to do it in externally in file folders, as files, and import them back after that.
Secondary problem: How to delete exessive JPEGs from photo library?
"Does one folder exclusively contain {jpg, jpeg} images and the other folder contain just {heic} images? "
Yes, that's correct. And folders are flat, no hierarghy. One contains JPEG's and another HEIC. Duplicates have identical file names.
So, main problem is:
How to delete JPEG duplicates matching by name HEIC photos AND not to delete JPEGs that don't have HEIC sibling.
If you script can help with that it's most welcome. I wonder what to do after I get the list though...
Photos is a self-contained image database. I wouldn’t recommend trying to hack around on it. You would likely corrupt the database. Just manually go though and delete any duplicate images. It is tedious, but easy enough. You can select multiple images and delete them in batches. If you select the first image to remove, that would probable be the JPEG. It doesn’t matter that much. HEIC can be smaller, but it is also a lossy format. The only way to get an actual “orignal” iPhone image is with a newer phone that supports ProRaw.
This is not a solution that can work on any Photos library. It is intended to compare filenames in two ordinary macOS folders. I would have to revise it in order to generate a list of matching JPEG candidates (with full paths) for removal.
If Beyond Compare can do the job, then I would suggest you use it.
"If Beyond Compare can do the job, then I would suggest you use it."
Partially.
Long story short: Can't figure out how to compare files in Beyond Compare by creation date instead of filename.
I exported duplicates from photo library to two folders - JPG and HEIC. Separated them by Smart Albums. Now I can operate them as files and after cleanup procedures export back to Pholo library. Just have to make no mistakes! =)
Turned out that some absolutely different photos have the very same filename, though different formats (and file extensions) - JPG and HEIC. (Clarification example: Files img1234.jpg and img1234.heic in approx 10% cases have different contents. (I wonder how THAT could happen.)
So, the task now is to compare files not by filename but by timestamp in metadata. The only common criteria of identical JPG and HEIC is Composite Creation Date.
UPD: Seems that Beyond Compare finally CAN compare the dates! Makes my job a lot easier!
Fail. Beyond compare can't import metadata from HEIC files.
Out of ideas. Anything?
Compare two folders contents by filename