Check if all files in a folder and sub-folders are in another folder/sub-folder?

I have multiple copies of various folders with sub-folders, and am trying to consolidate them into another folder/sub-folder with a single copy. Before deleting the original folders/files, I want to make sure that all files in each original folder is in the new consolidated folder.

One way to achieve this would be to select the original folder on the left lister in Opus, and the consolidated folder on the right lister, then run a script that would do the following:

  1. put left lister in flatview, sort by name and then remove duplicates (you could do this with name, size, and modified date for speed, but there could be an option to use a name & hash of each file instead for greater accuracy).
  2. For each file in the list, it would traverse the folder structure of the right lister and check if it exists, saving the full path in another list if it doesn't exist (to be shown at end of script search operation).
  3. Show list of full paths

would be useful:

  • if the list could be copied to clipboard
  • the files in the list could be added to a collection so they could easily be copied to the consolidated folder.

Any help would be appreciated, along with any other ideas for improvements to this idea.

NOTE: There doesn't seem to be a specific tool for doing this, but I did find a bash script on StackExchange:

Have you tried the Synchronize tool?

Is your goal to sync/mirror two directories or to get the differences between them (because you mention a list of files being absent, which you'd like to copy finally -> which sounds like a sync again though o).

To quickly sync two directories with a press of a buttin I use robocopy.exe (it comes with windows).

@leavedoswindowopen 

Confirm MSG="Synchronize (mirror to destination) with Robocopy?\n\nfrom:\n{sourcepath$} \n\nto:\n{destpath$} " TITLE=Robocopy.exe
Robocopy.exe {sourcepath$} {destpath$} /V /E /NP /R:0 /W:0 /COPYALL /PURGE /DCOPY:T

You need the "Confirm" script addin for the confirmation dialog (or remove the line if you want to go without it):
https://www.haage-partner.de/forum/viewtopic.php?f=45&t=4926

You can also check out the CompareEx script addin:
https://www.haage-partner.de/forum/viewtopic.php?f=45&t=4956
It allows you to compare two tabs (in flatview as well). I have an updated version which is more flexible and not uploaded yet anywhere, but you might find the version I linked to to be sufficient to find out whether this would help you.

Saving the names and paths of missing/absent files into file/clipboard can be done with SelectEx, another script addin:

To confirm, the source and destination may have some of the same files, but in different places (relative to the two starting points), correct?

If so, I don't think the Sync tool or Robocopy will do what you want.

You could do it by producing a flat list of all files in & below both folders, sorted by Filename, Date, Size (or sorted by MD5 would be better, but takes longer to calculate), then compare the two lists using a Diff tool (e.g. WinMerge is free and decent; BeyondCompare is inexpensive and better).