File Comparison?

Is there a function here to compare the contents of files to find differences between them? I am importing some work into Scrivener, but there are multiple versions of some chapters and I would like to be able to find where they differ in an efficient way.

There is a compare function in the snapshots panel.
In this case you’d have to create a new document.
Then paste the text of a version of your chapter in it. (Don’t cut it from the source document. Use ctrl-a ctrl-c / new doc: ctrl-v.)
Take a snapshot of that new document.
image

Title the snapshot (make it clear which version of your chapter it is of).
image

Editor of your new document : delete all text. (The text you just cloned from your source document.)
Editor of your new document : paste the next version of your chapter.
Take a second snapshot, title that snapshot.
And so on and so on.
Then you’ll be able to compare a version of your chapter to another by selecting two of those snapshots, clicking the compare button.

image

image
(The order by which you select the two snapshots influences the display. Should I have selected “version one” first, it is “two” that would have been scratched off, “one” displayed in blue.)
image

. . . . . . . . . . . . .

You can navigate from a difference to the next using these two arrows :
image
… or as you normally would in the editor, scrolling and clicking.

. . . . . . . . . . . . .

OPTIONAL : Once you are done creating snapshots for the different versions of your chapter, you could once more in the editor of that new document copy the body text of the version of your chapter you like the most, and use that new document as a replacement of your original chapter ; editing the text in the editor while having the snapshots comparison right next to it, the whole now being a single document.

If you feel unsecure with the manipulation, make sure to backup your project first.

Note that if you already know which version it is that you intend to do the editing to, you could potentially skip creating a snapshot for this one version, as it is possible to compare a snapshot to the editor content, when clicking “compare” with a single snapshot selected.
I personally would do a snapshot of it still, so that I have a backup of its original state, but I’d keep it for last in the sequence I instructed above, so that I can keep that version of my chapter live in the editor of my new document. (Meaning that I wouldn’t have to delete it from the editor in order to create the snapshot of another version. – It being last : I’d be done with that at this point.)

2 Likes

Depending on the original source, you could also compare them outside of Scrivener before importing. Word has excellent comparison tools, for instance.

I use WinMerge. It’s open source and portable (no installation necessary);

Similar tools — both freeware — are Diffinity and WinDiff.

2 Likes

Thank you! Very detailed explanation. I’ll give it a try.

Thanks, that might be easiest for things I haven’t already imported into Scrivener.

You are welcome.
As the name suggests, it also allows you to MERGE docs. No Copy and Paste necessary. You step through the differences, and decide what to keep and what to leave out.

And then it spits you out a new third document ?

Not necessarily. It guess it could (via the 3-way option).
I usually stick to 2 docs only. And decide what should go into what direction, left or right. What should be moved over or left out. To compare more than 2 docs, I use another tool that comes with my file manager, but I didn’t mention it because it’s not freeware.

How could one compare the text of 2 or 3 documents?

Mm, It probably depends on what exactly you mean by “compare” and what documents you want to compare.

The easiest way is probably to open the docs in quick reference windows and put them side by side.

Or used both editors windows.

“Snapshots” allow you to compare different versions of the “same” document.

Probably the best way is to compile both documents to Word and use Review > Compare in Word.

In Scrivener, saving both versions as Snapshots and use the Snapshot manager to compare to Editor or compare two Snapshots, comes close.

I do not have Word.

So there obviously is no such option as in Word, OpenOffice, other word processors.

In Scrivener, saving both versions as Snapshots and use the Snapshot manager to compare to Editor or compare two Snapshots, comes close.

How would one do that? Where is that snapshot manager?

The snapshots feature is introduced in the Interactive Tutorial, from the Help menu, in the section named, “Snapshots”, toward the beginning. After showing you how to create a snapshot, it then shows how to compare them.

Refer to §15.8, Using Snapshots in the user manual, for all of the details on snapshots, and the Snapshots Manager, which refers to comparison, and cross-references you to §13.6.4, Comparing Changes with Main Text, where you will see a demonstration of how it works, in Figure 13.13.

Ah, OK, great, many thanks!

I can’t believe no one mentioned the Matching Text pane. Incredibly useful. It even gives you a little pie chart indicating the level of similarity between texts.

For Windows users, sadly, this is not a thing yet, which is probably why it hasn’t come up. For direct comparisons between two very similar sources, snapshot comparison is good though. Matching text is better when you have no idea if something out there might be the same, and once you do find it, exactly what is the same about it.

1 Like