A program for comparing two text files. Program for comparing text files Compare Suite - fast and complete analysis of differences between texts

Friends, I am glad to welcome you to the pages of my blog. Today I want to tell you about 4 ways to compare files by content. The need to find differences arises quite often. You have to compare files by type or size. Comparing files in Word and Excel is also a very common procedure in offices and offices, where you constantly have to work with text documents and tables.

But for a webmaster or site owner, it is often necessary to compare two files based on content. And we are not talking about text files, although they are also analyzed in the same way, but about .html, .css, .php and so on formats. Those files where you need to find changes in the code. And sometimes changing just one sign can cause a lot of difficulties in achieving results.

So, last example, when I used a comparison of two files, there is a problem with the operation of comments. I mentioned this in mine. The reason was just one space. Just imagine how you can find such an insignificant difference manually.

And, in general, when working with website files, you often have to analyze the code. Doing this manually is unrealistic. It’s much easier to use available tools, tools that every webmaster and website owner should have.

Method 1. Comparing files in Total Commander.

I have been using this program for a long time. For working with files, in my opinion, this is one of the best programs. Total program Commander is paid, but you can also use a trial version for 30 days, which will also work after the end of the time, but with an offer to purchase. Download trial version Can .

Previously, I told you how to set up via TC, which allows you to easily manage site files and carry out all necessary operations directly from your computer, bypassing Personal Area hosting. This feature alone makes it worth using this program.

Now let’s look at a tool for comparing files by content, which also allows you to edit and copy data during the analysis process.

So, let's launch Total Commander– in one of the panels, select the first file for comparison – in the second panel, open the folder with the second file.

A new window will open, also divided into two panels. At the very top, in each panel there will be a time limit for selecting a file. In one of them, the first file will already be selected (but may be empty). To select a file you need to click on the small button with arrows (>>) .

After selecting files to compare, click on the button "Compare". The contents of the selected file will appear in each panel. Differences will be indicated by a background color.

To make changes to the file, just click on the button "Edit". And you can start making changes. The copy and rollback, search and encoding functions will also be available here.

If you have made changes to the file, then after closing the comparison window, you will be prompted to save the result.

Method 2. Comparing files in Notepad++.

If you have ever had to edit html files, css and php. You've probably heard about free editor Notepad++ code. You can download the program.

This is an excellent program, which, in addition to its innumerable advantages, also allows you to compare files according to their contents.

But this requires installing a small plugin. All this is done directly inside the editor itself.

So, launch the editor - go to the menu item "Plugins» "Plugin Manager""Show Plugin Manager".

In a new window, select the plugin « Compare" and press the button « Install".


After installing the plugin, you can start comparing the contents of files. To do this, you need to open two files - go to the menu item "Plugins"« Compare"« Compare (Alt+D)".

The result of the file comparison will be presented in separate panels. That is, the first file will be on the left, and the second on the right. Opposite the lines in which differences are found there will be a warning sign and highlighting in the background color.

The line where small differences are found will be highlighted in yellow and indicated with an exclamation mark.

A line that is completely different will be marked on one panel with a red minus and on the other with a green plus. And highlighted in the appropriate color.

Of course, once you find a difference, you can immediately make the necessary adjustments and save the changes.

You can complete the file comparison with a key combination Ctrl+Alt+D.

Method 3. Comparing the contents of two files in WinMerge.

This program allows you to compare not only the contents of files, but also the contents of entire folders. In this way it is similar to Total Commander, only the program is free. You can download it.

Installation of the program is standard and will not be difficult. Therefore, we will not dwell on this, but will immediately move on to the process of comparing two files.

After launching the program, you need to select files to compare. Open a menu item "File""Open".



The comparison result is presented in two panels, just like in the other examples. Only here the exact fragment of code that differs in a specific line is highlighted.

You can also edit files in this program. And when you close the comparison window, the program will offer to save the changes to the files.

Method 4: Compare files using the Windows command line.

This method allows you to compare the contents of files without third party programs. It is enough to use standard tool Windows operating system.

Also, this method does not allow you to edit files. To do this you need to use other tools. But, nevertheless, you can cope with the task without additional programs.

To do this, open "Start""All programs""Standard"« Command line» . And enter this command:

Fc /N path to the first file path to the second file

it looks like this:

Fc /N C:\My Documents\file1.txt C:\My Documents\file2.txt

The finished result will look like this:


When there are few differences, they can be corrected quickly enough using editing programs. But when there are many differences, it is quite difficult to analyze information using this method.

So, I told you about ways to compare files, and now I suggest you watch the video tutorial, in which I show comparing two files in all ways.

I am sure that now if you need to compare files, you can easily do this using one of the proposed methods.

That's all for today, I wish you all success and Have a good mood and see you in new articles and video tutorials!

Best regards, Maxim Zaitsev.

It happens that you have two almost identical texts, and you need to clearly see how exactly they differ. A common example: you “recorded” an interview from a tape recorder and sent it to a demanding interlocutor for proofreading. And he, instead of highlighting his edits in color, simply cut out some phrases, added new ones, and swapped paragraphs.

As a result, you seem to be reading your own interview, but you don’t recognize him “in makeup.” Manually compare two large text difficult - is it possible to make this task easier? website will tell you how.

Programmers often face such tasks, so file comparison programs can highlight syntax when comparing program codes of different programming languages. We need such programs to allow comparing texts in the usual .txt format and, preferably, in Word.

For comparison, we took several paragraphs of our article and replaced some words and swapped phrases. Now we will compare.

Microsoft Word

IN Microsoft program Starting from version 2007, Office can compare two files without leaving Word. Go to the menu item Review – Compare – Compare... (comparing two versions of a document). We specify two files, click the “More” button and mark the parameters by which you want to compare the text, and also select where to view the changes: in the first file, in the second or in a new one.

The program highlights deleted text with red strikethrough text, inserted text with red underline, and moved paragraphs with green text. In a separate panel on the left (not in the screenshot below) you can track changes for each word, and also see a summary: in our case, 57 corrections, of which 26 insertions, 29 deletions, 2 moves.

WinMerge is a free cross-platform file comparison utility that can be used on a rich "zoo" operating systems, starting with Windows 98. Latest version– WinMerge 2.14.0 – exists both as an installer (6.14 MB) and as a portable assembly. The program "out of the box" can only compare regular text files, and if we want to work also with office documents(texts in .doc, .docx, .odt formats, tables in .xls, .xlsx, .sxc formats, PDF files and others office files exotic formats), you need to download the Xdocdiff plugin. The plugin is connected as follows:

1) Unpack the archive with the plugin

2) Copy the xdoc2txt.exe and zlib.dll files to the folder with installed program WinMerge

3) Copy the entire MergePlugins folder along with the amb_xdocdiffPlugin.dll file to the folder with the installed WinMerge program

4) Launch WinMerge, go to the Add-ons menu – List, check the “Enable add-ons” checkbox

5) Go to the Add-ons menu – check the box “Unpack automatically”

That’s it, now you can open our two files: if you want, the usual “TEXT” files, or if you want, the “Word” ones.

The program will warn you that you can also specify archived files, but to do this you will have to download an archiver plugin. However, we are not afraid of its absence; we refuse future similar notifications and receive a window with our two texts. On the left side of the window there are two long columns: these are miniatures of our texts. Paragraphs in which changes were found are highlighted in yellow. Since there were such changes in each of the three paragraphs of our source text, both columns are colored yellow. Specific changed words are highlighted in light yellow.

But the program has many settings, so it’s easy to highlight the words in some other color.

There are many programs for comparing files, including text files, but their main drawback is the price. Compare it! costs $29 per license, Beyond Compare – $30, Compare Suite – $70, DiffDoc Professional – as much as $399.95. Let's look at the example of this last, most expensive program, how much better it is than the free WinMerge.

Download the program (7 MB) and run it. The result is very similar to what we got Microsoft Office 2007, only the arrangement of the speakers is different. Red strikethrough – text that has been changed, red underline – text to which the original one has been changed (red strikethrough); blue strikethrough – cut text, green – moved (or added “from scratch”) text.

It turns out that there is practically no difference. If the user honestly bought an expensive office Microsoft package, then there is no point in spending another $400 on the official purchase and registration of this program. There is no need to use even the “trial” version if the same functionality is provided by standard Word, especially since the unregistered version of DiffDoc Professional reminds you of the need to purchase every 15 minutes.

Finally, let's check one of the many online services for comparing texts: DiffNow

The service seems to support downloading doc files, “swallowed” them, wrote “Files compared successfully,” but instead of the normal result it produced a binary set of zeros and ones, in which, however, it highlighted the differences. Therefore, it is better to copy and paste the text manually. The site highlights changes like this: brown – changed text, blue – deleted, burgundy – added, purple – changed words in changed sentences. Service supports various settings(you can also change colors), but we couldn’t get rid of one drawback with any settings: the text is elongated in length like a programmer, so you have to use horizontal scrolling.

The article uses an example to discuss working with Compare Suite - the most powerful program for comparison text files. Comparing two simple text files

The program for comparing text files Compare Suite is a convenient and perfectly optimized utility for analyzing and synchronizing almost any documents used when working on a computer. To compare documents created in the Microsoft office suite, PDF files, and other types. Just as easily and extremely quickly, the utility allows you to analyze and compare entire directories with documents, although the main purpose of Compare Suite is a program for comparing text files. We will focus on this function of the program on this page. Let's launch Compare Suite and select "New file comparison" from the menu. The same command is executed using the hotkey combination Shift+Ctrl+F. Then you need to tell the program which text files we need to compare; the most convenient way is to use the drag-and-drop technique - placing each file being compared in its own window with the mouse.

After that no additional actions not required - the program for comparing text files Compare Suite will do its job automatically. By selecting another method of comparing files from the three possible in the menu (character by character, word by word or by " keywords") you will run new procedure comparisons. There in the menu you can also set conditions for comparison, for example - “ignore all spaces in the text”. The menu items "Go to next (previous) difference" will automatically move the cursor position to the required line. The same actions are initiated by the hotkeys "Ctrl+N" and "Ctrl+P".

It should be especially noted that the Compare Suite program for comparing text files has the ability to “highlight” special characters, used in various languages programming and text markup.

In addition, the Compare Suite program for comparing text files makes it possible to compare the contents of a text file with the contents of the clipboard, and edit the text directly in its window. The edited file can, of course, be saved later. Compare Suite, a program for comparing text files, works correctly with different encodings text. In the screenshots given as an illustration, the “right” text file was deliberately converted to UTF-8 encoding, that is, into those very “crazy things” that the built-in Widows Notepad gives in to. The Compare Suite program for comparing text files also freely handles text files in the formats of various operating systems, such as Windows, Unix and Mac systems.

Often when working you have to compare various modifications of documents, for example, the original and modified editions of materials prepared in Word or in the form of PDF documents or presentations, working and updated versions price lists with changed prices in Excel, different versions text documents and so on. In this case, the question is not which version of the files is more recent (this is already clear from the properties of the files), but what is important is what exactly has changed in the documents in terms of content. Comparing documents manually is a thankless task because it takes too much time and the possibility of errors, because you might not notice some important detail when viewing it couldn't be easier. It is much more reasonable to delegate the task of comparing files to a computer. In general, in terms of comparing Word documents, everything is going quite well even without the use of auxiliary tools, although in versions of Word 2002 and Word 2003 this opportunity it is reliably hidden from prying eyes, and probably not many users are even aware of its existence. The fact is that to compare documents here you must first download original file. Then, from the Tools menu, open the Compare and Merge Corrections command, specify the file to compare with the original, and enable the Black Lines checkbox. Only after these manipulations will the “Merge” button turn into the “Compare” button, and when you click on this button, the program will compare the files.

The results of the comparison will be shown in the newly created document in traditional review mode. With the advent of Word 2007, everything has become much easier, since now you just need to switch to the "Review" tab, click on the "Compare" button and specify the versions of the document you are comparing. The result of the comparison will be presented in a new document, where the reviewed document will be displayed on the left, taking into account the changes, and on the right (one above the other) the original and changed documents. Theoretically, in Excel it is also possible to compare documents using built-in tools, however, only when working in the mode of recording changes. However, this is inconvenient, since each of the changed cells will have to be viewed by hovering the mouse over it, since changes made to the document are displayed in pop-up windows (about the same as regular notes).

Secondly, if the named mode is not first enabled (command "Tools" > "Corrections" > "Select corrections", checkbox "Track corrections"), then it will be impossible to compare XLS files.

Concerning quick comparison PDF documents, then this feature, of course, is available in Acrobat 9 Pro and Acrobat 9 Pro Extended, but these solutions are not installed on every computer. Therefore, if you need to quickly compare Excel tables, PDF documents, presentations, as well as documents in other formats, in particular, text files and program codes, you have to resort to using additional tools. There are many options here, and these can be complex solutions that allow you to work with several file formats, and highly specialized utilities. A considerable part similar decisions is offered for decent money - for example, the price of one of the most famous complex solutions in this area, Diff Doc, is $99.95, and the Araxis Merge utility, which is very popular among programmers, is priced at €119. At the same time, there are also quite affordable or generally available on the market. free programs of a similar plan, it is precisely such solutions that we will evaluate in this article. At the same time, we will focus on complex solutions, and among highly specialized tools we will note only utilities for quick comparison Excel tables, since this is one of the most pressing tasks, and comparing Excel documents with complex solutions, although possible, is less effective than using highly specialized utilities.

⇡ Comprehensive solutions for quick comparison of documents

Compare Suite 7.0

Developer: AKS-Labs
Distribution size: 3.79 MB
Spreading: shareware Compare Suite - handy tool for quick comparison of text files, MS Office documents, RTF documents, PDF files, web pages (HTM), PowerPoint presentations, binary and some other types of files, as well as files in ZIP and RAR archives and on FTP servers. When comparing program listings in a number of programming languages ​​(Object Pascal, HTML, C/C++, JavaScript, PHP, etc.), syntax highlighting is provided. There is functionality for synchronizing text files and comparing folders with subfolders. The demo version of the program (available in Russian localization) is operational for 30 days and is fully functional. The commercial version costs $60. The technology for comparing files in Compare Suite is simple. First, you select a method for comparing files, for which you need to select one of the options in the “Compare” menu: “character by character”, “word by word”, “by keywords”. Classic character-by-character comparison is useful in situations where you need to capture the slightest differences in the spelling of words - for example, when comparing program listings. Word-by-word comparison of documents is typically used for comparison different versions the same file. Using the keyword comparison method, you can compare dissimilar documents even when word-by-word comparison is not possible.

After selecting the comparison method, in the “File” menu you need to select the “New file comparison” command and indicate the files to compare in the left and right panels. The program will analyze the files and highlight all existing differences (added, changed and deleted fragments) in different colors. Additionally, you can create a comparison report with detailed information about the files being compared (command "File" > "Report"). When comparing files other than text, you should keep in mind that their comparison in all complex solutions (both in Compare Suite and in other utilities) is carried out after conversion to text format. In practice, this means, for example, that if in the compared versions of a Word document the same word in a particular sentence appears on different lines, then it will be included in the list of changes. When comparing XLS documents, data from tables is extracted before analysis, and the differences found are displayed row by row in text format indicating the sheet name and column names, which allows you to navigate the data. The same scheme is used to compare PDF documents and PowerPoint presentations.