Program for checking text files. How to compare the contents of two files. How to compare files using the Windows command line

18.12.2019 Hard disks

Why are various programs of a certain direction created, for example, there is various options defragmenters or registry cleaners? I think that the user would have the choice to use one or another program that is most convenient to use for specific needs. After all, the user not only gives preference to some program simply for its convenience, but also finds additional functions, which distinguishes the selected option from other programs of this type.

As is known, computer it's universal tool, intended for various types of activities, one of which, and perhaps especially in demand, is creation of texts, documents in various text editors. It is not uncommon for a user to be faced with the question of what is different, for example one document from another, or need to compare previously written text with subsequent entries, and find differences, and perhaps combine several similar texts. But with what? After all, doing it manually is long and boring. In fact, such instruments programs for comparison there are quite a lot, and it is clear that among them there are paid and free options. For example, in Microsoft Word it is possible not only to place two documents in one window, but also compare their By content.

Features of ZFC.
But now I would like to talk about other similar options text comparisons. There is one free program ZSKSoft File Comparer (ZFC), which, unlike Word can compare text files as usual format with extension txt, so files V format Word And Excel automatically converting them to "flat text" before comparison. Another difference from programs of this type is that ZFC combines content both files in one window, highlighting with color what has been added and what has been removed. This is not to say that every user will like this principle. It all depends on a person’s habits and preferences, but if you imagine an option where you need to find a small difference in the text, and as the example given by the developers: if in a line only 100 rubles are corrected to 1000 rubles, then this will be clearly and most informatively noticeable in this display option. In this case, the added zero will be highlighted in color, and it is easy to notice.

In addition, the program can compare Not only text, but also binary files. And also show the result in text, and in hexadecimal. She works in encoding WINDOWS And DOS.

Installation and configuration.
The installation itself, like most programs, does not cause problems. The only thing that should be noted is that for the program to work under Windows 7 with the ability to compare not only files txt, but also Word, Excel, you should install version 1.31 beta 2.
At the top of the program window, in the “View” item, check “Auto line break”, for convenience movements according to the text.

Here, if necessary, you can check the “DOS encoding” and “hexadecimal format” items. This can be done later, for convenience. fast switching These items are on the toolbar.

To make individual changes to the settings, click this item,

and in the window that opens, on the first tab “View”, you can select font size, and set the required color to highlight text during comparison.

Set your preferred color by clicking "Change". In this window you can not only select the highlight color, but also the background color, and font properties.

On the next tab, Transformations, you can change the rules transformations V simple text. For example you can add file type format Microsoft Word 2010. To do this, click the "Properties" button

and edit in the window file types by entering ".docx" with a period in front. You can delete or add your own conversion rules.

In the “Other” item, leave or uncheck the following items: “Remember window coordinates when exiting” and “Remember modes when exiting”, at your discretion.

ZFC operation
After starting the program, to compare files, select a menu item

In the window that opens, click on the folder icon on the right side and add the first file required for comparison, it will be considered - " a new version". Then the second one, "old version".

After clicking the "OK" button, the text will appear in the program window, with sections of the files that have differences highlighted. By default, what is added to the first text will be colored in a warmer red color, and what is removed, that is, what is not in the first text, will be colored in a colder, blue color. It takes some getting used to, but it's not difficult.

Programs that can compare documents can be very useful and will also save you time and effort. You can find many such applications on the Internet, but this article presents the best utilities for comparing two documents.

ABBYY FineReader 14

ABBYY FineReader 14 - one of best programs for comparison text files. Using this utility, you will be able to find differences in text between two versions of a document. Thanks to FineReader, you won't have to spend a long time and painstakingly comparing each line of text. The Compare Documents feature can identify differences between versions of a document in various file formats, including PDF, Word, and many others.

Here are the most impressive features that come with this program:

  • With ABBYY FineReader 14 you can automatically compare files, which will save your time and effort.
  • This software allows you to detect all the differences in the text between two versions of the same document in just a few seconds.
  • FineReader is an incredibly intuitive utility that allows you to compare two text document.
  • Using FineReader, you can compare two versions of text in documents different formats, including files Microsoft Office, PDF files, scanned documents and others. Of course, you can also compare files of the same type.
  • ABBYY FineReader 14 supports text comparison in 35 languages. The program can automatically detect the document language. No difference between documents will go unnoticed.
  • FineReader highlights elements that do not match between two documents and places the texts next to each other, making it easy to notice the differences in the files.
  • Only those different elements that affect the meaning of the content are highlighted, excluding minor differences.

ExamDiff

ExamDiff is a free file comparison program that can automatically detect differences in documents. The program is compatible with Windows and is ideal for comparing files. It is easy to use and has a number of useful features:

  • Using this software, you will be able to compare directories and binaries.
  • You can perform three-way splits and merges, and edit files within diff areas.
  • You can highlight syntax and ignore comments.
  • There is no need to specify the name of both files. All you have to do is enter the name of the folder that contains one of the files to compare.
  • The software has an auto-select feature that is capable of remembering matching pairs of files.
  • ExamDiff can automatically detect file changes and request that documents be compared again.
  • You also have access to a drag-and-drop feature that allows you to drag one or two files onto the software window.
  • The program has a fully customizable file extension filter.

WinMerge

What is this program? WinMerge is software for comparing and merging documents on Windows. The program is capable of comparing both files and folders and shows the comparison result in a visual and understandable text format.

Here best features that are included in this software:

  • WinMerge supports Windows and has a tabbed interface.
  • This is a flexible editor with syntax highlighting, line numbering and word wrapping.
  • WinMerge can also show differences in two vertical areas.
  • File filters allow you to exclude or include different elements.
  • The program can also compare files in one folder, which in turn may include subdirectories.
  • The comparison results are presented in the form of a tree.

Other significant features include shell integration, plugin support, localizable interface, and online manual.

Araxis Merge

Araxis Merge has two versions. It's important to note that only the pro version provides three-way comparison, merging, and all related features. On the other hand, the standard version is identical but only has two-way join and comparison.

Here are others functionality that are included in this program:

  • Purchasing a license will allow you to use both versions of Merge.
  • You will be able to compare huge files using the 64-bit version of the program, and you will also be able to take advantage of the huge amounts of memory that are available on 64-bit systems.
  • You will be able to identify deletions, insertions and all kinds of changes in different versions source code, as well as configuration, text and web files.
  • The program offers you the opportunity to save time by directly downloading and comparing popular formats files.
  • You can also copy text from other applications and paste it into the text comparison window.

GroupDocs

GroupDocs makes it easy for developers to improve their online, desktop and mobile applications, and also provides the ability to display, annotate, convert, compare and merge documents.

Here are the best features that are included in GroupDocs:

  • You can get a summary report of the differences by comparing two versions of the same document using the File Compare API on any cross-platform app.
  • The GroupDocs for .NET comparison is intended for Windows programs and any type of application based on the .NET Framework 2.0 or later.
  • You can download free trial version this program to see if it's right for you.

Total Commander

As an application for comparing files, you can use Total Commander. What is Total Commander for? This is one of best utilities for working with various files. Total Commander allows you to perform any actions with files and folders in two clicks, and with the help of this program you can compare two documents.

The comparison result will be highlighted background color, and the two files will open in adjacent windows, where it will be more convenient to edit them.

Total Commander can also be used as a file synchronization program. This can be done using the "Synchronize directories" item in the "Commands" menu.

Windows Command Line

If you just need to compare files without editing, you can use the standard Windows 8 command line.

To do this, simply go to the Start menu, type cmd in the search bar and run the cmd.exe application found. Then enter the command fc /N X Z, where X is the path to the first document (for example, C:\Documents\text1.txt), and Z is the path to the second (for example, C:\Documents\text2.txt). The result should be a line like this: fc /N C:\Documents\text1.txt C:\Documents\text2.txt.

After entering the line, press Enter to start checking the files.

If there are few differences in the files, then this method will help identify them, but if there are a large number of differences between the documents, it is better to download another program.

Notepad++ with plugins

Notepad++ is a program that allows you to edit text files. It supports a large number of programming languages ​​and is suitable for both programmers and those for whom the modest functionality of the standard Notepad is not enough.

In addition to its basic functions, Notepad++ can be used as a file comparison program. However, for this you need to install a plugin. After installing the plugin on Notepad, you will be able to compare the files you are interested in.

The results will be displayed in two separate panels, with different elements highlighted in different colors. If you wish, you can edit the files and save the changes. The program can be downloaded for free, and there is also a version of Notepad in Russian.

Diffuse

Diffuse was designed specifically for code comparison. It supports dozens of programming languages ​​and automatically uses highlighting when language is recognized.

Unfortunately, there is no way to turn off the color highlighting in the program, and some users may not like the excessive use of color, which interferes with the work.

The program also supports merging and editing selected files.

AptDiff

AptDif is a file comparison program for Windows. When you launch the utility, a window pops up allowing you to select two files to compare.

After this, both selected files are displayed in the interface. The app uses colors to highlight added, deleted, or changed content in any file.

You can switch the window layout from vertical to horizontal if you wish, and edit one or both files directly in the program window.

DiffMerge

DiffMerge does not display a file selection dialog when launched. You need to select one of the supported modes from the File menu to get started.

File diff and Merge work similarly to other file diff tools. When you select the Diff option, both files are displayed next to each other. The program uses the color red to highlight the differences between the two selected files.

You can edit files directly in the program, export differences, or use the merge tool to merge data.

On the other hand, the Folder diff feature compares files in selected folders and highlights identical and different documents.

KDiff3

Another program for comparing files. When you launch KDiff3, a window will pop up which is used to load one, two or three files for comparison. Open files are displayed next to each other.

The program uses colors to indicate changes on both sides. Plain black on white text indicates identical lines or characters, while green, blue, or red colors indicate that the content is not the same as another file.

In addition to options for comparing files with each other, you can also merge selected content different ways. For example, you can prioritize the content in one of the files, or set the program to automatically resolve major differences to save time.

Meld

To use Meld, you need to install Python 2 on your computer. Meld works alongside Python 2 and will install the required components unless you uncheck the box during installation.

The software supports two-way and three-way comparison of files and folders.

It highlights the differences between downloaded files directly and uses colors for visualization in the interface window. From the majority similar programs What makes Meld different is the way it visualizes comparison results. The result is presented in the form of blocks connected to each other in both files.

Meld supports file merging and many other options, such as tabs to load multiple comparisons at once.

Free program for comparing text files and folders. It has a user-friendly interface, syntax highlighting for many programming languages, as well as extensive settings. In addition, the program can create reports and work in conjunction with many version control systems.

Human laziness can work wonders! Laziness in the good sense of the word :). Well, you must agree that it is unreasonable to do routine work manually if it is possible to entrust it to a computer. So today’s program was found precisely in an attempt to shift the labor-intensive process of comparing different text files onto the PC’s shoulders.

And it was like this... Recently Ruslan Bogdanov and I were translating website in HTML5 using Schema.org markup. At the same time, it was necessary to often compare the old (not yet edited) version of each page with the new one, in which certain edits had already been made.

And after a couple of hours of working in two Notepad windows, the idea occurred to me that there should be a program for automatic search differences in text files. This question was asked to the ubiquitous Google, and such a program was found :). It's called WinMerge.

This program automatically finds and displays the difference in the contents of two text files, which allows you to compare and edit open documents much faster than with a regular visual search! In terms of its capabilities, WinMerge is only slightly inferior to paid competitors, such as, for example, Compare Suite:

Comparison with a paid analogue

In addition, both programs support a variety of encodings (including Unicode), can be included in almost any version control system and allow you to compare even archived documents (to support WinMerge this function, the installed 7-ZIP archiver and a special plugin are required).

Installing WinMerge

The program has two versions: a regular installer and a portable version. To work with a portable one, you will only need to unpack it from the archive and (if desired) run the bat file ( Register.bat) to integrate application items into the system context menu (the second “body file” ( UnRegister.bat) you can remove this item).

If you choose a standard installer, you will need to run it from the downloaded archive and follow the instructions of the installation wizard. You can agree to all offers by clicking “Next” until you get to the component selection screen:

Here, carefully check the default language(s): it should be “Russian”. You can also install additional plugins that will add several new prefilters to the program.

The next step requiring your intervention will be the window for selecting additional tasks:

By default, WinMerge only creates a shortcut in the panel quick launch and integrates into the context menu. You can also create a shortcut on the Desktop (which, IMHO, is more convenient :)) and add the program folder to the system path for quick access.

Comparing text files in WinMerge

Once the installation is complete, a blank WinMerge window will open. To get started, you will need to open a couple of files that are to be compared. This can be done by calling the “Open” item from the “File” menu, or by clicking on the button of the same name on the toolbar:

In the window that opens, you are given the opportunity to specify the files that will be compared by clicking the “Browse” button, as well as select filters (used to exclude certain types of files when working with folders) and an unpacker for archived files (if the appropriate plugin is installed).

Essentially, all we have to do is select the files that will be displayed in the left and right panels, and we can click “Ok”.

The WinMerge window will look something like this:

So what can we do with all this:

  1. Using the buttons on the toolbar (or context menu) You can navigate through the differences found and quickly copy changes from one file to another.
  2. Using the Difference Map (Locations window), you can quickly assess the location of differences in different documents. At the same time, there are several color symbols on the “map”:
  • yellow - indicates any difference in the documents;
  • red - indicates the selected difference;
  • gray - indicates a missing part of the code in one of the documents.
  • Using the Differences window, you can see the part of the code that is different. You cannot edit the code here, but you can copy it using the function in the context menu.
  • And, naturally, with the help of windows with open documents We can carry out both quick copying of code fragments and complete editing. Essentially, we have before us an ordinary text editor, like an advanced Notepad with syntax highlighting for many programming languages ​​(and you can customize the backlight colors for each language in the settings)!
  • I also advise you to periodically pay attention to the status bar at the very bottom of the working window when working with the program. In it you can sometimes see various hints, as well as a counter for differences found.

    Upon completion of working with documents (or if necessary), you can save both both edited files or only individual ones. To do this, go to the “File” menu and select “Save file on the left” or “Save file on the right”, respectively:

    Setting up the program

    In principle, after installation the program is completely ready for use. However, you can slightly improve or change some of its functions. The first thing you can do is add convenience to yourself :). You can do this by going to the “View” menu and activating the “Show line numbers” and “Word wrap” items:

    This will add a column with line numbering in front of the panel with the code, and the lines themselves will now fit into any panel size due to automatic transfer text (while the structure of the lines is completely preserved)!

    In the same menu, you can activate some other features (such as displaying non-printing characters and tab indents), as well as disable any elements of the working window (for example, you can disable the comparison panel and/or the “map” of differences).

    For some programming languages ​​and programs, WinMerge has add-ons that allow you to ignore certain parameters when comparing files. If you checked the option to install plugins when installing the program, you can find these options in the “Add-ons” menu:

    Here in the “Pre-comparison” section we have access to add-ons for:

    • ignoring comments;
    • ignoring columns (apparently for HEX);
    • ignoring punctuation;
    • ignoring tabs;
    • ignoring line numbers.

    To be honest, I didn’t use these plugins, since the standard capabilities of WinMerge were quite enough for me, but they may be useful to someone;).

    If these features of the program are not enough for you, then you can easily adjust almost everything in “Settings”:

    You can get lost in these settings in no time, since there are a lot of them, but I will only pay attention to those that may be useful to us for further work.

    In the first group of settings (“Basic”), I would recommend activating two options: “Automatically set to first difference” (for greater convenience) and “Folder comparisons” in the “Enable multiple comparison windows for” section. The last option will allow you to open an unlimited number of tabs with comparisons when comparing folders (which we will talk about below).

    The following settings to be changed are located in the “Comparison” section:

    In principle, you don’t have to change anything here, but during the work I encountered a number of inconveniences that can be avoided by activating some items in this settings section.

    First, you can disable the comparison of non-printable characters. This can significantly narrow down the search for differences in files.

    Secondly, you can enable skipping of empty lines and commands in different registers, which will also reduce the number of mismatches between files.

    Thirdly, there is an option to filter comments, which is similar to that in the “Add-ons” menu. All these settings are optional, but can sometimes significantly reduce the number of differences found in files.

    Compare folders

    In addition to the fact that in WinMerge we can automatically compare files, we can also compare folders, finding all the changed files in them! However, there is no special button for opening a folder in the program. How to be? We need to indicate in the “Left” field any file from the directory we need, and then remove its name, leaving only the folder name:

    After this manipulation, the “Right” field will automatically switch to the “Directory Selection” mode and we will only have to select the desired folder.

    A special feature of the folder comparison mode is that all files are displayed in one general list. Wherein:


    Now, if in “Settings” you have activated the option of multiple tabs when comparing folders, then you can open any subfolders and files - their comparison will open in a new tab.

    Generating reports

    If you work in a development team or need to present the results of your work to third parties, then the function of creating reports based on comparison results will be useful to you. You can find this function in the “Tools” menu:

    The report generation window contains only two fields: in the first we specify the file to save (possibly non-existent), and in the second we select the report style. There are four style options available in WinMerge:

    1. Comma separated list (plain text, such as a TXT file).
    2. List with delimited tabs (also a text file).
    3. Simple HTML (web page format (in my opinion, the most convenient)).
    4. Simple XML (also better to open in a browser, since this format allows you to collapse unnecessary comparison branches).

    Select any of the styles, and then click “Browse” and indicate in which folder and under what name (as well as with what name extension) to save the report. Click “Ok” and rejoice :).

    Here (in the “Tools” menu) you will find a few more items that will appeal only to serious developers. These are functions for creating patches and filtering the contents of files and directories.

    The first allows you to create files containing a list of differences in different versions of the source code. This list can be used, for example, to automatically correct the final version in the final project using various systems version control.

    The second function allows you to set exceptions for compared files in directories by mask or file type. There are also ready-made presets for various types of projects and the ability to create your own filters of any complexity.

    Advantages and disadvantages of the program

    • high accuracy of difference recognition;
    • the ability to quickly replace text fragments;
    • the ability to compare folders;
    • reporting function;
    • extensive settings.
    • You cannot compare more than two documents;
    • to support archives, installation of additional software is required;
    • There is no keyword search function.

    conclusions

    Having tested several free programs for comparing files, I found that WinMerge works most correctly. The percentage of errors when matching files was minimal, which means that the program can be used in everyday activities. At the same time, the number of false recognitions can be further reduced by working with the settings.

    If you work with texts and need to compare frequently different versions the same document, then WinMerge can significantly facilitate and speed up your work. But the computer was created for this purpose: to take on as much routine as possible, leaving us time for creativity;).

    P.S. Permission granted to freely copy and quote this article provided that an open active link to the source is indicated and the authorship of Ruslan Tertyshny is preserved.

    The procedure for comparing two files is perhaps one of the most common and popular. You can compare files by type, size, or content. One of the most popular procedures is comparing files by their content. The essence of this procedure is to find differences in the contents of files. You can compare any files, not just text ones. Today we will compare two word files.

    Comparing files in Total Commander

    To perform comparison operations between several files using this program, you need to select the first file to compare in one of the panels, and select the second in the second panel.

    Then open the “file” menu item and go to the “compare by contents” item.

    A window should appear divided into two columns. At the top of the columns there is a box with a file selection function. Having selected a file to compare, you will need to click the “compare” button.

    The contents of the compared files will be displayed in two columns. Differences found in the files will be highlighted. To edit the contents of the file, you must click the “edit” button.

    How to compare files using the Windows command line

    To compare files by Windows tools you need to go to the “start” menu, go to the “command line” section and enter a command with the following content:

    FC File Location #1 and File Location #2.

    In our case it turns out like this

    FC C:\User\Admin\Desktop\1\1.docx C:\User\Admin\Desktop\1\2.docx

    As a result, a window will be formed displaying the results of the file comparison. When comparing small files with a small number of differences, the process of editing them will be carried out quite quickly. But with large file sizes for comparison, this procedure will be quite labor-intensive.

    How to compare files online?

    Comparing files using special programs always involves the installation of a specific software product that performs the comparison procedure. But this method is not always convenient. Sometimes you have to understand the program interface or the required functionality may simply not be enough. In this case, it is better to resort to online services.

    Today you can find a large number of online services for comparing files. The online file comparison procedure allows you to quickly and without unnecessary installations software products make a comparison necessary files. Typically, these services have a simple and intuitive interface designed for the average Internet user. Processing of operations necessary for comparison usually occurs in seconds, since it does not depend on the resources of your system.

    We go to the website https://www.kontrolnaya-rabota.ru/s/online-calculators/sravnenie-tekstov/. Select the files that need to be compared. Just below, click Compare text files.

    Data can be compared in ways Various types files are not only text. All of the file comparison methods considered, of course, have both advantages and disadvantages. But thanks to each of the ones discussed, you can easily compare the contents of files or their structure and make changes.