![]() |
MS-DEFCON 2:
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it.
|
-
Compare Contents of Two Documents
Home › Forums › AskWoody support › Microsoft Office by version › Compare Contents of Two Documents
- This topic has 25 replies, 10 voices, and was last updated 2 months, 3 weeks ago.
Viewing 18 reply threads-
AuthorPosts
-
-
September 27, 2020 at 2:01 am #2299232
Nathan Parker
AskWoody_MVPI have two long lists of book titles I need to compare the differences between and see if one list has all of the titles from the second list or is missing any titles.
In terms of word processors, I have Word, BBEdit, TextEdit, Nota Bene, Google Docs, Mellel, Nisus Writer Pro, and Pages.
Is there a way to accomplish this, or would I have to simply comb through the lists manually?
Thanks!
Nathan Parker
-
September 27, 2020 at 3:23 am #2299244
access-mdb
AskWoody MVPPersonally I would use Access to import the list as two tables and then use the query wizard to list what’s in one and not in the other. I suspect that as you’re on a Mac this isn’t available, but do you have a relational database app?
Otherwise use Excel (or similar). Copy the two lists into separate columns and sort them (separately). Go to the midpoint of the list (e.g. 100 items, go to line 50). If they match there’s no difference in lines 1-50. Delete them and repeat. If you find a non match then the extra ones are in the first 50 lines (using the example). Go to the midpoint of those and compare. Just rinse and repeat. You don’t say how long your lists are, so this method might take longer for more. But it’s actually quite efficient. And it will find differences in both columns.
2 users thanked author for this post.
-
September 27, 2020 at 7:14 am #2299252
anonymous
GuestYou have not written the type of files that the long lists are in, but if .txt text files you could try “WinMerge” – see https://winmerge.org/downloads/?lang=en .
There is a portable version of WinMerge (scroll down to the unofficial PortableApps link at the page above) so you don’t need to install it if this is just a temporary thing.
I have a combination of 2 programs set up as described at https://dottech.org/167404/how-to-add-compare-to-and-compare-later-options-to-context-menu-in-windows-tip/ which achieves the same kind of thing i.e. a side by side comparison of files.
I only continue with this method because I am familiar with it, but portable WinMerge might be better if you are starting from scratch.
1 user thanked author for this post.
-
September 27, 2020 at 7:47 am #2299254
Kathy Stevens
AskWoody LoungerIt would help to have a little more information regarding how the lists were created.
Are both lists in the same format?
Are they variations of the same MS Word document? Are they in Excel? Etc.
If they are variations of the same MS Word document you can use Word’s compare tool.
If not, and assuming that the lists are in the same format, you can paste the list into two separate Word documents, format each list so that each title is on a separate line using the same order (title, author, etc.). Separate the components of each title using the tab key. Then cut and paste each document into an Excel sheet. Sort the columns of each Excel sheet by title. Then cut and paste the titles form each list into a third Excel sheet, sort the columns alphabetically, and compare.
1 user thanked author for this post.
-
September 27, 2020 at 12:13 pm #2299279
mn–
AskWoody Lounger… are the lists ordered?
A lot of the usual “diff” tools will be a lot less useful if ordering is also significant. Oh and numbered lists are a bit of a bother requiring some additional work.
The traditional way for plaintext files on Unix/Linux is to use the sort command line tool (forcing a fixed order for entries in a file), and then diff.
Also if you only need to know how many entries are in only one of the lists, then you can do a concatenation with “sort file1 file2 |uniq -u” to report any lines that occur only once across both files. This won’t tell you which file any given line was in, though.
(“sort -df …” to ignore case differences and non-alphanumeric characters in sort, “diff -iw” to ignore case and whitespace on a line in diff, “uniq -i” will also ignore case.)
2 users thanked author for this post.
-
-
September 27, 2020 at 8:10 am #2299255
anonymous
Guest1 user thanked author for this post.
-
September 27, 2020 at 10:06 am #2299267
Ascaris
AskWoody_MVPI use the excellent Meld program for this. While it is primarily a Linux tool, it does have a Windows and an unofficial (so far… it sounds like they may be planning Mac support from the way they put it, but not yet) Mac build also.
Group "L" (KDE Neon Linux 5.20.5 User Edition)
2 users thanked author for this post.
-
September 29, 2020 at 6:19 am #2299803
geekdom
AskWoody PlusExactly what I’ve been looking for. This site provides nice, useful resource software information.
Beta Work {Got backup and coffee}
offline▸ Win10Pro 2004.19041.572 x64 i3-3220 RAM8GB HDD Firefox83.0b3 WindowsDefender TRV=1909 WuMgr
offline▸ Win10Pro 20H2.19042.685 x86 Atom N270 RAM2GB HDD WindowsDefender WuMgr GuineaPigVariant
online▸ Win10Pro 2004.19041.746 x64 i5-9400 RAM16GB HDD Firefox85.0 WindowsDefender TRV=2004 WuMgr1 user thanked author for this post.
-
-
September 27, 2020 at 11:57 am #2299276
Kathy Stevens
AskWoody LoungerThen there is the no brainier approach.
Open both files.
Block and copy the first title in the “base document” and do a search for it in the “second document”.
If the search reveals that a title appears in both documents highlight it in both documents and move on to the second title in the “base document” and repeat the process.
At the end of the process the titles that are not highlighted are not duplicated in either file.
1 user thanked author for this post.
-
September 27, 2020 at 9:48 pm #2299392
Nathan Parker
AskWoody_MVPOne list is on a web page at the moment, but I can copy the entire list into any form of document type (so I could do Word, TXT, RTF, etc).
The second is a list inside a software app, but it gives me an option to copy all where I could again paste it into any document type.
They both don’t seem to be in the same order, even though they should be since they’re a similar list of books.
Nathan Parker
-
September 27, 2020 at 10:59 pm #2299400
Kathy Stevens
AskWoody Lounger
-
-
September 28, 2020 at 6:58 am #2299448
anonymous
GuestTurn both versions into Word documents. Save both.
I have Word 2019 – open one document, then Review/Compare with the second?
I recall that earlier versions of Word and Wordperfect had a similar tool.
1 user thanked author for this post.
-
September 28, 2020 at 12:13 pm #2299525
Vincenzo
AskWoody LoungerI would turn them both into Word docs, use the built in tools to alphabetize them. (they may have to be in tables, can’t quite remember, in order to alphabetize.
Then go to Review Tab. then Compare/Two Versions of a doc (legal blackline).
I think you can do it in Excel too, but I’ve not done that.
-
This reply was modified 3 months, 3 weeks ago by
Vincenzo.
1 user thanked author for this post.
-
This reply was modified 3 months, 3 weeks ago by
-
September 28, 2020 at 8:35 pm #2299720
Nathan Parker
AskWoody_MVP -
September 29, 2020 at 4:58 am #2299787
access-mdb
AskWoody MVPA way to do this in Excel is on https://trumpexcel.com/compare-two-columns/, look for
Example: Compare Two Columns and Highlight Mismatched Data
This works with a small sample by highlighting all in column 1 that are not in column 2 and vice versa and using styles to show differences. The list don’t have to be sorted. I shall be using this in future when I have lists to compare.
Google sheets doesn’t appear to have this but probably MS Excel online might. I’ll have a look later.
1 user thanked author for this post.
-
September 29, 2020 at 5:45 am #2299793
access-mdb
AskWoody MVPWell I’ve found an even simpler way in Excel. Put your data into one column, select it. Now go to Data/remove duplicates. All done! Well it was in my simple test. Of course, you won’t find duplicates like ‘Lord of the Rings, The’ and ‘The Lord of the Rings’.
-
This reply was modified 3 months, 3 weeks ago by
access-mdb.
1 user thanked author for this post.
-
This reply was modified 3 months, 3 weeks ago by
-
September 29, 2020 at 6:48 am #2299808
doriel
AskWoody LoungerI use Notepad ++
Download plugin “Compare” – it takes 10 seconds
Output is crystal clear – I added two linesBut this is not for DOCX documents, just for plain text, source codes, etc.
Dell Latitude E6530, Intel Core i5 @ 2.6 GHz, 4GB RAM, W10 1809 Enterprise
HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29
Attachments:
You must be logged in to access attached files.
1 user thanked author for this post.
-
September 29, 2020 at 8:05 am #2299825
access-mdb
AskWoody MVPThanks Doriel, I had forgotten that Notepad++ had a compare plugin. The only thing I would say is that I had more differences than you and the output is a bit confusing (better learn how to interpret it). Nathan has said he has over 1600 titles, so this might not be easy (unless there’s not many differences). I think using Remove differences in Excel is much easier, but it’s always good to have more than one way of doing things!
Attachments:
You must be logged in to access attached files.
2 users thanked author for this post.
-
September 29, 2020 at 8:09 am #2299831
doriel
AskWoody LoungerI agree, you are absolutely true. Notepad++ is just basic tasks. When comparing so much titles, this is not the best nor easiest way.
But it can help sometimes when performing basic tasks. Hope this colud help somebody.
Thank you for the Excel how-to!Dell Latitude E6530, Intel Core i5 @ 2.6 GHz, 4GB RAM, W10 1809 Enterprise
HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29
1 user thanked author for this post.
-
-
-
October 24, 2020 at 8:14 pm #2306761
Nathan Parker
AskWoody_MVPI managed to compare the content of both documents using Excel. Bad news is it turns out that both lists display the titles differently (some titles are listed with minor differences between the two lists), so there are a ton of “false differences”. I’ll still have to comb through them to see the real differences between the two.
Nathan Parker
-
October 25, 2020 at 12:10 am #2306794
Kathy Stevens
AskWoody LoungerNathan
When you set up your Excel sheets did you set up one column of book titles, one column of authors last name, one column of authors other names, etc.?
If you did, you can sort your sheet by author and title.
What I do when I have a problem similar to yours is to block, copy, and paste each list into a Word document using text only paste. I then go into each title and separate each component of the listing by tabs (title, tab, authors last name, tab, authors other name, etc.) Once the entire Word document is formatted you can simply copy and paste the material into an Excel sheet and each component of the list that is separated by a tab will fall into a different column. Once an Excel sheet is complete you can sort your list of titles by author’s last name, title, etc.
Do the same for the second list of the books.
Then standardize the columns between the two Excel sheets, and then you can copy and paste the second Excel sheet into the first and then sort by author, title, etc.
By sorting by author you should be able to reconcile the variations between the two lists of publications.
-
October 25, 2020 at 12:27 am #2306796
Kathy Stevens
AskWoody Lounger
-
-
-
October 24, 2020 at 9:51 pm #2306775
OscarCP
AskWoody PlusNathan: “I have two long lists of book titles I need to compare the differences between and see if one list has all of the titles from the second list or is missing any titles.”
If you can copy the two documents to a plain text file each (i.e. two ASCII files), then you can open Terminal and type in the command line:
$ diff file1 file2 >diference
where “file1”, “file2” are whatever the files are actually called, while the file “difference” has all the, well, differences between the two lists.
You could pipe the output of diff to some formatting utility to get a nicer listing of the differences, but I woldn’t bother:
$ diff file1 file2 | whatever > difference
There are also different options in “diff” that make it possible to deal with binary files, mixed binary/ASCII, etc. and to learn about them and how to use them the command is:
$ man diff
That opens a list of options with the description of what each one does. One clicks on the space bar to move from the current page to the next one.
Then the command with one or more of those options would be:
$ diff option_1 option_2 option_3 … file1 file 2 > difference , or else:
$ …. | whatever > difference.
(“$” is whatever screen prompt you get in Terminal, and the command is to be typed right after the prompt.)
Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)
1 user thanked author for this post.
-
October 24, 2020 at 10:16 pm #2306783
Nathan Parker
AskWoody_MVP-
October 24, 2020 at 10:48 pm #2306787
OscarCP
AskWoody PlusI just tried to show you an example, but this got mysteriously blocked by Waterfox.
Now I am trying again, with “Chrome”, see how this goes:
Anyhow, you get a list of line comparisons with “<” indicating a line from the first file and “>” indicating one from the second file, both listed one immediately after the other, separated by a line “—–” whenever they are different.
If there is one line in one file without a counterpart in the other, that unpaired line gets listed by itself (the difference here is between it and another line does not exist).
Lines that are identical in both files are not listed.
And so on.
It does not matter whether on line is a title or not: all lines are considered to be just “lines.”
Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)
1 user thanked author for this post.
-
October 24, 2020 at 11:34 pm #2306793
OscarCP
AskWoody PlusAdded to my previous comment: The length of the lists has been mentioned here as a possible problem when they are “long.”
It does not matter how long are the lists being compared with”diff”, because it can compare gigabyte-size long files (but taking some time doing that… ) With more normal size files, say up to a megabyte, it takes practically the blinking of an eye (or two blinks, depending on the machine one is using).
Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)
1 user thanked author for this post.
-
-
-
October 25, 2020 at 12:11 am #2306795
PaulK
AskWoody LoungerIf in Windows, use the FC (File Compare) command. See [ FC /? ] for syntax. Some of the switches support really powerful functionality. As others have commented, it is almost imperative that the data be in textual format.
I do [ FC file1.txt file2.txt > file12.txt ]. (’12’ means differences file of ‘1’ vs ‘2’.)
To clear false differences (due to formatting?), edit file1.txt, save as file3.txt. If necessary, edited file2.txt becomes file4.txt. Repeat recursively.
2 users thanked author for this post.
-
October 25, 2020 at 12:51 am #2306797
OscarCP
AskWoody PlusPaulK: Yes, thanks for pointing this out.
Same as “diff”, “FC” is a very handy DOS file-compare application, at least for ASCII files (I’ve only used it with that type of files.).
The idea in FC is the same as that in “diff” found in macOS, Linux, Unix, FreeBSD, etc. I think that several DOS commands were actually ports, from UNIX to IBM-clone Intel PCs, of “Terminal” line commands with their names and the exact way they are written somewhat modified. In the Macs and in Linux PCs “diff” is one of the operating system’s tools. I believe that, at least in the days when Win 7 was young, it was also part of “Windows Tools” along with other UNIX commands. It used to be available in Linux-emulation software for Windows, such as Cygwin. Linux emulation might be done differently in Windows 10, now that MS has decided to participate actively in the Linux universe.
By the way, the file where the differences are saved can have any name the user likes to choose. I wrote “differences” but it can be anything else, as long is it is a normal text file name.
Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)
1 user thanked author for this post.
-
-
October 25, 2020 at 8:17 pm #2306965
Nathan Parker
AskWoody_MVP
-
-
AuthorPosts
Viewing 18 reply threads -
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments. Click here for details and to sign up.
Search The Lounge
Recent Replies
anonymous on Susan recommending version 2004
1 minute agoanonymous on So I opened up an HP and where’s the hard drive?
2 minutes agoBob99 on Find the cable modem that’s just right for your ISP
20 minutes agoBundaburra on Which version of MS Office should we buy and where can we get it?
22 minutes agoDrcard:)) on How to put a picture ("Avatar") on your replies
26 minutes agogeekdom on Which version of MS Office should we buy and where can we get it?
1 hour, 55 minutes agoabbodi86 on Tasks for the weekend – January 9, 2021
2 hours, 39 minutes agoBundaburra on Fiber optic not available; options please
2 hours, 50 minutes agojohnf on Laptop with home and work networks
3 hours, 11 minutes agoRoger on Which version of MS Office should we buy and where can we get it?
3 hours, 12 minutes agoSFB on Find the cable modem that’s just right for your ISP
3 hours, 14 minutes agoBundaburra on Which version of MS Office should we buy and where can we get it?
3 hours, 24 minutes agoBill C. on Four GB of RAM vanishes … but then reappears
3 hours, 29 minutes agoCijan on Tasks for the weekend – January 9, 2021
3 hours, 36 minutes agodeuce120 on Susan recommending version 2004
4 hours, 13 minutes agoSusan Bradley on So I opened up an HP and where’s the hard drive?
4 hours, 21 minutes agoSusan Bradley on So I opened up an HP and where’s the hard drive?
4 hours, 22 minutes agoanonymous on What Linux is and why it has persisted
4 hours, 23 minutes agoanonymous on What Linux is and why it has persisted
4 hours, 23 minutes agoanonymous on What Linux is and why it has persisted
4 hours, 23 minutes agoanonymous on What Linux is and why it has persisted
4 hours, 23 minutes agoanonymous on What Linux is and why it has persisted
4 hours, 24 minutes agoanonymous on Windows 10 2004/20H2 Not Being Offered Due to Conexant HD Audio Issue
4 hours, 24 minutes agogeekdom on Is this the best science fiction show ever?
5 hours, 9 minutes agogeekdom on PNY Flash Drive Problem
5 hours, 15 minutes agoalkhall on So I opened up an HP and where’s the hard drive?
5 hours, 16 minutes agoLoneWolf on So I opened up an HP and where’s the hard drive?
5 hours, 20 minutes agocarpintero on How to be sure Flash Player is gone everywhere in Win10-1909?
5 hours, 51 minutes agoDriftyDonN on Find the cable modem that’s just right for your ISP
6 hours, Just nowDriftyDonN on Find the cable modem that’s just right for your ISP
6 hours, 2 minutes ago
Recent Topics
-
Linux is now completely usable on the Mac mini M1
6 hours, 22 minutes ago
-
User Feed Synchronization – Disable/Delete Task?
6 hours, 59 minutes ago
-
AV Alert from JetAudio Plus
8 hours, 36 minutes ago
-
System Restore Stopped Working
10 hours, 22 minutes ago
-
Malwarebytes was targeted by SolarWinds hackers too
18 hours, 45 minutes ago
-
So I opened up an HP and where’s the hard drive?
2 minutes ago
-
Which version of MS Office should we buy and where can we get it?
22 minutes ago
-
Fiber optic not available; options please
2 hours, 50 minutes ago
-
Best W10-Pro updater program ?
18 hours, 27 minutes ago
-
Accessing Old Laptop HD
18 hours, 15 minutes ago
-
DNSpooq lets attackers poison DNS cache – A Patch
1 day, 6 hours ago
-
Nitro data breach – what does it mean to me?
19 hours, 35 minutes ago
-
Check Point : “FreakOut” malware exploits new Linux vulnerabilities
1 day, 7 hours ago
-
How to STOP Outlook Hotmail config forcing signin to Office 2019
1 day, 7 hours ago
-
Permission on public desktop gets reset
1 day, 8 hours ago
-
Surface Pro 4 & Win v2004 update fail
1 day, 7 hours ago
-
Extra USB Sound driver?
18 hours ago
-
PNY Flash Drive Problem
5 hours, 15 minutes ago
-
Windows 10 bug crashes your PC when you access this location
2 days, 7 hours ago
-
Doesn’t like external FAT32 HDD
7 hours, 14 minutes ago
-
Why won’t Task Scheduler launch Office product
9 hours, 35 minutes ago
-
Susan recommending version 2004
1 minute ago
-
Replace Images for Text in Word
2 days, 9 hours ago
-
Windows 10 internet connection freezes
1 day, 16 hours ago
-
Windows Defender In Win 10 Concern
11 hours ago
-
Laptop with home and work networks
3 hours, 11 minutes ago
-
Top 40+ iOS 14 Tips and Tricks
2 days, 15 hours ago
-
What Linux is and why it has persisted
4 hours, 23 minutes ago
-
Find the cable modem that’s just right for your ISP
20 minutes ago
-
Four GB of RAM vanishes … but then reappears
3 hours, 29 minutes ago
Search for Topics
Recent blog posts
- So I opened up an HP and where’s the hard drive?
- What Linux is and why it has persisted
- Find the cable modem that’s just right for your ISP
- Four GB of RAM vanishes … but then reappears
- Wow! Even more Office updates!
- Giving you the choice
- Tasks for the weekend – January 16, 2021
- Zero day Windows 10 bug
Key Links
Copyright © 2004 – 2021 AskWoody Tech LLC. All rights reserved.