Dialog box: Compare by content
 
With this dialog box you can compare two text or binary files with each other. To do this, please proceed as follows:
1. Select the two files you want to compare in Total Commander
2. Select Files - Compare by content
3. With "Next difference", you can jump to the next difference found between the two files
 
When you open the dialog box, Total Commander will execute step 3 automatically with the first two files selected in the active file panel. You can also always choose two other files (or drop them via drag&drop to the edit boxes) for a new comparison and press the compare button.
 
Compare Starts the comparison between the two chosen files. If the two files are identical, this will be shown with a dialog box only. Otherwise the differences will be shown in the two text windows. Binary files will be shown in hexadecimal mode, and text files in text mode. Files up to 1 MB (configurable via MaxCompareSizeInMem) will be loaded completely into memory, so the originals will remain editable. Larger files will only be mapped to memory, i.e. they remain locked during the comparison.
 
Next difference Jumps to the next difference found. A continuous block of different lines will be regarded as ONE difference.
 
Previous difference Jumps to the previous difference (backwards). This function is the reverse of the previous function.
 
Font Chooses the font for the two list windows.
 
Start search for text in BOTH files simultaneously
 
Continue search
 
Show the two windows above each other
 
Opens the save dialog to save the changed file(s).
 
Edit mode Allows you to directly edit the two files. Supports both text and Unicode files. The two files are kept synchronous automatically. Newly added and changed lines get the line number 0, existing lines keep their line number from the original file. When closing or re-comparing, you will be asked whether you want to save the modified file(s). When saving, the type of line end (Windows, Unix, Mac) is determined by the majority of line ends of the original file, e.g. if the original contained Windows line ends with a few Unix line ends, the saved file will contain only Windows line ends. You can use F6 to enter edit mode.
 
Show only differences, with extra lines:
Only show lines which either differ between the two files, or which were changed by the internal editor. The function allows you to show additional lines above and below the difference, to understand the context. This checkbox is hidden while in edit mode. It's possible to temporarily leave edit mode to toggle this option.
 
Sync: 1 Determines how inserted text is handled within a line. In Total Commander 10 and older versions, if there was a difference, a search was made for at least 3 matching characters, and the comparison continued there, even if it was in the middle of a word (option 1). The comparison can now be resumed either at a space (2) or a user-defined separator character (3), or the synchronization can be disabled entirely, e.g. for tables (0).
 
Copy -> Copies the selected text from the left to the right (or the upper to the lower) window, replacing the corresponding lines in the other window. Useful in conjunction with the buttons "Next difference" and "Previous difference". If no text is selected, the entire line will be copied. This button is hidden while not in edit mode.
 
Copy <- As above, but in the opposite direction.
 
Undo Undo of the last change. All changes up to the original state of the two files can be undone. The cursor is always placed to its position after the last change before actually undoing the change. Hotkeys: CTRL+Z or ALT+BACK.
 
Binary Compares in binary mode, i.e. fixed line width, hexadecimal display.
8/16/24/32 Bytes Only shown in binary mode: Set the number of bytes per line.
ANSI<->ANSI Allows you to choose the text encoding type, e.g. one side UTF-8 and the other ANSI if the text type was not detected automatically.
Case sensitive If checked, two texts which only differ in case (uppercase/lowercase) will be considered as different. This is useful when comparing C source code.
If unchecked, texts which only differ in case are considered equal. This should be used e.g. for Pascal and Basic source code.
This function and the two immediately below has no effect on the comparison in binary mode.
Ignore repeated spaces
If this option is checked, multiple spaces are counted like one, and spaces at the start and end of a line are ignored completely. Example: "test1   test2   " and "test1 test2" are recognized as identical lines.
Note: This is only used to determine whether two lines are the same or not. Once a difference is detected or a line is being changed, this option isn't used to compare characters within a line.
Ignore frequent lines
When finding new matching lines after encountering a difference, ignore lines which occur very often in the compared files, e.g. begin/end statements in source code. This gives a much better result when entire paragraphs have been added or removed.
 
Right click menu The right click context menu contains the following entries:
Copy selection to clipboard
Copies the selected text to the clipboard
Paste here Pastes text from the clipboard. Only available in edit mode.
Resync comparison from here
If the compare function gets out of sync, e.g. because large paragraphs have changed place, you can re-align two lines manually. You need to select the two lines in the left and right panel before choosing this function. When chosen once a file has been modified, Undo will be possible only up to this point.
Swap Panels Swaps the contents of the left and right panel
 
<Two line list> Shows the current line from the active side together with the corresponding line on the other side, to make it easier to spot small differences like added/removed characters. This list can be scrolled sideways via cursor left/right, PageUp/PageDown, Home/End, or the mouse wheel. It can be hidden with the icon on the left of the status line, or with hotkey F9. Press Ctrl+Tab to jump from one of the main panels to this list and back.
 
The dialog can be closed with ESC, ALT+F4 or the close button in the title bar. As with lister, multiple compare dialogs can stay open, and Total Commander can still be used!
 
Important note: In text compare mode, multiple consecutive white space characters or tabulators are treated as if they were one white space, e.g. "a     b" is the same as "a b". If you don't want this, please deactivate the above option "Ignore repeated spaces".
 
The following shortcuts work in this window:
Ctrl+C, Ctrl+Insert Copy selected text
Ctrl+F Search
Ctrl+U Swap panels
Shift+F10, Menu key Show context menu
Alt+Up/Down arrow Jump to previous/next difference
ESC Close dialog
F7 Search
F3 Continue search
Ctrl+F3 Reverse search direction
Shift+F3 Search backwards (next F3 searches forwards)
F6 Enable/Disable edit mode
F9 Enable/Disable two line list
 
Only in edit mode:
Ctrl+V, Shift+Insert Paste text from clipboard
Ctrl+S Show save dialog
Ctrl+Z Undo
Ctrl+Left/Right arrow Move cursor by words
Alt+Backspace Undo
Alt+Left/Right arrow Copy selected text to left/right panel
Delete Delete selection/text to the right of the cursor
Backspace Delete selection/text to the left of the cursor
Double click Select word under cursor
Triple click Select entire line
F2/Shift+F2 Jump to next/previous difference within a line
 
Only in read only mode:
Insert/Spacebar Select line
Left/Right arrow Scroll by 1 character
Alt+Left/Right arrow Scroll by 30 characters