Merging two folders with same filename (but different file contents)

Hello,

I am running Dopus 11.19 x64 on Windows 7 x64.

I have been trying to tidy up my pictures collection stored in various folders/subfolders historically taken by different mobiles with the same brand and/or different brands.

When I am trying to merge the folders , there are hundreds of different pictures files with the same name but different content.

Example:

Xperia Z
--Pictures
---DSC_001.JPG (xxx.bytes)

Xperia Z5
--Pictures
---DSC_001.JPG (yyy.bytes)

For my archives , both old and new files (with the same name) are important and to kept, not overwritten. According to the standard dialog box which comes up in Dpous, I can either skip or overwrite, but there is no way to keep both the files in the same folder.

So I am asking is there is a plugin/script which compares the filenames and gives an option to rename either of the files if both files are not exact replica of each others.

Hope the query is clear.

Thanks for your input.

If you copy folder over folder with the same name with files with the same names inside, you should have option "Rename New" (and "Rename New All") while you holding CTRL (or CTRL+SHIFT) on Confirm File Replace dialog window.

The dialog gives you all these options (plus more inside the Skip button-menu):

As PeterB says, you can hold the keys shown in the menu (Shift, Ctrl, etc.) to get quick access to the commands from the main button, without having to open and select from the menu.

See The Confirm File Replace Dialog in the manual for more detail.

Thanks for the guidance. Just one more related query , while using the "Rename new (All)" or "Rename Old (All)" , we see that opus adds a suffix (1)..n to the same matching filenames with different contents.

Is there a way to control or define our own prefix or suffix, for example if I chose to rename old, I would like to add prefix or suffix "_old" to such files or "_old(1...n)".

Thanks for your answers.

+1 for customize suffixes.

_1, _2, _3 will be nice and doesn't add space in filename.

Rename Old adds " (original)" to the name. It's only Rename New which adds a number (unless there's already a file with the specified name).

There isn't a way to change those at the moment, other than manually typing a different name for the files (which the Replace dialog also allows), or doing the copy/move with a custom script.

You could also add metadata to the filenames before merging the folders, e.g. DateTaken, Camera Model.

That sounds like a good idea, this way filenames would be rendered different. Any guidance of a best suggested way to do it.

Thanks.

Well, just go crazy with the Rename command :slight_smile:

Here is an example:

New name:
{datetaken|D#yyyy}\{datetaken|D#yyyy-MM-dd}\* {datetaken|D#yyyy-MM-dd T#HH.mm.ss} {cameramodel}

It really depends on your preferences and the quality of your pictures' metadata. I personally use a folder structure like in the example above and rename pictures from mobile devices simply to "yyyy-MM-dd HH.mm.ss" plus any special suffix like PANO. Pictures from "real" cameras keep their original name like DSC12345 plus a padding digit.

Thanks a lot. Planning to go crazy (with rename command) soon enough.

Digging an old thread , just exactly after 1 year (+ 2 days).

So I was able to experiment with the rename command to tailor a renaming mask for my existing photos. Thanks to @lxp in his reply above.

However I was searching if I can only apply such renaming mask selectively when copying one folder contents over the other.

As mentioned by @Leo above , when DO sees a duplicate file name it gives the "Confirm File Replace" dialog box with selected options (as can be seen in the screenshot)

In the "Replace" sub menu there are only limited options to play with either newer or older file which would simply add a prefix of "(1)" after the file name.

Is it possible that within replace submenu, I can specifiy DO to:

  1. First calculate the MD5 for both files, just be sure that two files with "same name" actually have different content.

  2. If MD5 is "not" equal then apply an advanced file renaming mask preset - from rename command options. i have saved a preset as below screenshot.

  1. If MD5 is equal , then carry on and replace the newer file with the older.

Not sure whether it is possible thru the standard Copy/Replace/Rename command or can we construct a routine or script to perform the same.

Appreciate your expert guidance and help, it will greatly help me organize a large and messed up pile of digital photos which I am trying to tame.

Thanks.

Without scripting, you'd have to do it in two steps, unless you want everything to be structured like in your rename preset (in which case you could do everything via the rename dialog/command instead, since it can move files as well).

Doing it in two steps could involve running the duplicate finder after the copy, and then searching for any remaining * (1).jpg or similar files and applying the rename to them.

Note that the Replace dialog highlights size, date and description differences in bold, and has an option to skip things where the size and date are identical. That's often enough to know if a file is actually different, unless there's a workflow which makes changes but preserves the old file dates and does not change the file sizes. (With JPEGs, that'd probably be where unless only the metadata was edited and the editing tool was configured to preserve the date.)

With scripting, you could split the files into ones which exist and don't exist already, copy/move the ones that don't exist normally, and then apply a rename to the ones that do exist and have different contents. That'd be more work to set up though.

  1. Got a hang of the two step process as you suggested. How is it that rename command can move files as well. Can you please guide about it.

  2. Can you give me a starting point and some example of the scripting option so I can try digging in that direction.

Thanks for your every helping support Leo.