Removing duplicate binder docs

I have a project where I’ve discovered that a number of files have an exact duplicate elsewhere in the project. I stumbled on the first few by accident. My suspicions aroused, I discovered the rest when I ran a duplicate file utility (TreeSize) on the project folder, which did an MD5 check on all the content.rtf files.

My question: Since I want to

  1. get rid of each dupe, and
  2. don’t care which of the dupes I keep, and
  3. don’t want to have to locate the files in the project by searching for each one…

…what would happen if I just closed the project, then manually deleted one of each dupe pair, then reopened the project?

Would Scrivener deal with those missing files kindly, perhaps telling me they’re missing and offering a nice solution, or would the project be corrupted?

Or, is there some other less blunt force way of doing this?

Personally, I would close the project, then duplicate the whole project folder (in File Explorer), rename the new one with a clear prefix or suffix.

Then I’d do what you’ve described on the new copy.
Then load it in Scrivener.

A: it worked. Okay.

B: it didn’t work. Trash the new/clone version. I’d look for some other way.

. . . . . . . . .

Are you sure your script detects and lists as positives only 100% identical files?

2 Likes

Thanks Vincent. I just tried that on a copy of the project.

When I reloaded the project, Scrivener complained not at all.

However, the item remained in the binder, but it’s content was empty. That makes some sense. Maybe I should have deleted the whole folder?

Of maybe I should just do it the old fashioned way and find the files one by one…..

1 Like

Assuming you confine such removals to the UUID numbered folders in Files/Data, and the Snapshots subfolder, nothing! There is no difference between an empty binder item you haven’t written anything into yet, and one you deleted the contents for externally.

Before doing that though, I would empty the trash to make sure none of the duplicates are just discarded copies.

After reload:

  1. Hold down Alt on the File menu and use the “Save and Rebuild Search Indexes” menu command.
  2. Optional: run a project search for *, with the search scope set to “Text”, and then flip the “Invert Results” option toward the bottom. This will find all empty items. You can select the search results, make a new collection out of them, and then remove entries from the collection as you look them over; maybe just to delete them, maybe to move the other copy to where the empty one ended up, etc.
2 Likes

Love the * trick for blank files. The other way is to search titles for 1 and then 2 as duplicates will be in format file name-1, file name-2. Now will also find files with dates or other numbers with 1 or 2 so look at list. Below is an example.

2 Likes

Thank you all. These replies were all helpful.

I’m not sure how or when the dupes got created. They share the identical names in the binder, without an appended number, so they weren’t created by the Duplicate command. They were in different folders.

I thought maybe I had dragged them intending to move them but instead copied them, but testing just now I’m unable to find any mod key drag action that actually copies or duplicates the doc rather than just moving it. (Is that really so?)

I didn’t compare or make note of their created and modified dates, but I suspect they were either identical or long ago enough to not tell me anything useful.

But this project consists almost entirely of preexisting files that were imported into Scrivener as sets, each roughly corresponding to the Explorer folder where the files resided. Basically, replicating within a single Scrivener project a multi-folder/multi-document Word project — where in Explorer a mod key makes the difference between a drag-copy and a drag-move. So the dupes likely existed in the original source folders. I just never noticed them. I could check in the backup of the backup in the archives… but no, I am not going to!

1 Like

one other trick. (see image below) Use the Outliner to find duplicate documents in your Project.

  1. Click on Binder.
  2. Click on expand all icon (I added in the toolbar)
  3. Use Ctrl + A to select all the documents.
  4. Right-click and add these to a new collection. Call it anything you want.
  5. In the Collection Header, click the curved arrow to view all the files in a group mode.
  6. Choose the Outliner mode. Add a column for word count and move it next to the Title and Synopsis Column which by default is the first on the left.
  7. Under the title of the document if you click the down caret you can put them in alphabetical order.
  8. Scroll down the list of documents for duplicates and look at the word count to see if versions with the same name are identical.

Still have to look through your list but now everything is in alphabetical order.

Thought of this. Might help

2 Likes