How to compare two texts and read a diff
When you edit a contract clause, a config file or a translation, the risk is rarely the line you meant to change. It is the paragraph that shifted, the trailing spaces that came with a copy, or the word you replaced everywhere when you meant only one place.
Set the direction straight
A diff only makes sense when you know which side is old. Keep the version you received on the left and the edited version on the right, and save both with their source and date. If the sides are swapped later, every addition looks like a deletion.
For a long document, compare the same paragraph range rather than whole files. A moved paragraph can produce a large block of apparent changes that hides the small real edit.
Read the context, not just the marked lines
Line-based tools show a changed line as changed, even when only one character differs. Look at the surrounding line before deciding it is intended: a changed word may be a good edit, while a changed line that looks identical often hides trailing spaces or a typographic quote.
A missing closing sentence, a lost capital letter or a doubled word are the kinds of errors that survive a normal read-through because the brain supplies what should be there.
Use replace with the same care
Before replacing everywhere, test one match. If a product name also appears inside an address or a code identifier, replacing all of it will break those places. Try a narrower search first, then widen it once the sample result looks right.
Clean text is useful before a diff, but it changes evidence: removing blank lines and duplicates can hide a spacing mistake you wanted to see. Keep an untouched copy of both versions until the comparison is done.
A review routine that takes a minute
- Compare old against new, with dates in the file names
- Count the additions and deletions; does the number match your intention?
- Read each changed line with its neighbouring line
- Search the result for the old term to ensure no stale copy remains
- Paste the final version once into the place that will actually be used