Compare by content: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
(interwiki)
(Removed __NoEDITSEction__directive. Added intro. Renamed section Compare By Content to Usage. Removed misused section header formatting.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NoEDITSEction__
__FORCETOC__
 
'''Compare by content''' is an [[internal function]] of [[Total Commander]] that compares two files by there contents.
==Compare By Content==


== Usage ==
You can find this function in the main menu "Files -> Compare by Content".
You can find this function in the main menu "Files -> Compare by Content".


Line 24: Line 24:


'''Dialog box: Compare by content (32 bit version only)'''
'''Dialog box: Compare by content (32 bit version only)'''
[[image:COMBCON.JPG|center]]
[[image:COMBCON.PNG|center]]




Line 40: Line 40:
{|border=1 cellspacing="0" cellpadding="5"
{|border=1 cellspacing="0" cellpadding="5"
|valign="top" width="150px"|
|valign="top" width="150px"|
=====Compare=====
'''Compare'''
|Starts the comparison between the two chosen files. If the two files are identical, this will be shown with a [[Compare_by_content#| 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 2 MB 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.
|Starts the comparison between the two chosen files. If the two files are identical, this will be shown with a [[Compare_by_content#| 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 2 MB 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.
|-
|-
|valign="top"|
|valign="top"|
=====Next difference=====
'''Next difference'''
|Jumps to the next difference found. A continuous block of different lines will be regarded as ONE difference.
|Jumps to the next difference found. A continuous block of different lines will be regarded as ONE difference.
|-
|-
|valign="top"|
|valign="top"|
=====Previous difference=====
'''Previous difference'''
|Jumps to the previous difference (backwards). This function is the reverse of the previous function.
|Jumps to the previous difference (backwards). This function is the reverse of the previous function.
|-
|-
|valign="top"|
|valign="top"|
=====Font=====
'''Font'''
|Chooses the font for the two list windows.
|Chooses the font for the two list windows.
|-
|-
Line 65: Line 65:
|-
|-
|valign="top"|
|valign="top"|
=====Case sensitive=====
'''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 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.
If unchecked, texts which only differ in case are considered equal. This should be used e.g. for Pascal and Basic source code.
Line 71: Line 71:
|-
|-
|valign="top"|
|valign="top"|
=====Binary=====
'''Binary'''
|Compares in binary mode, i.e. fixed line width, hexadecimal display.
|Compares in binary mode, i.e. fixed line width, hexadecimal display.
|-
|-
|valign="top"|
|valign="top"|
=====Unicode=====
'''Unicode'''
|Compares in unicode mode (UTF-16).
|Compares in unicode mode (UTF-16).
|}
|}
Line 92: Line 92:


{|style="background:#f8f8f8"
{|style="background:#f8f8f8"
!colspan="2"|<font color="#f8f8f8">
!colspan="2"|The following shortcuts work in this window:
=====shortcuts=====
</font>The following shortcuts work in this window:
|-
|-
|width="150px"|Insert
|width="150px"|Insert
Line 137: Line 135:
*
*


{{translated|Vergleich_nach_Inhalt|Internal functions}}
{{translated|Vergleich_nach_Inhalt|List of internal functions}}
[[Category:Internal functions]]

Latest revision as of 22:58, 13 October 2009

Compare by content is an internal function of Total Commander that compares two files by there contents.

Usage

You can find this function in the main menu "Files -> Compare by Content".

As the name tells this function compares two files by their content byte by byte.

If the files identical you get a message which contains the full path to both compared files.

IDENT.JPG

In the 32 bit version the differences are displayed in color in a dual list. In the 16 bit version only the result of the comparison is shown (same or different).

The two files are chosen as follows:

  • If more than one file is selected, the two first will be compared
  • If only one file is selected, it will be compared with the first selected file in the target window
  • If only one file is selected, and no file is selected in the target window, it will be compared with a file in the other window, having the same name (if it exists)
  • If no file is selected, the file under the cursor is compared with a file in the other window, having the same name
  • When there is neither a file selected in the target panel nor a matching filename found Total Commander takes the file that is selected/under Cursor and loads it to the Compare by Content Tool and let's you browse for the other.

When Total Commander does not choose the desired files you still may browse for some others.

Dialog box: Compare by content (32 bit version only)

COMBCON.PNG



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 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 2 MB 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.
Search.jpg Start search for text in BOTH files simultaneously
Searchfo.jpg Continue search
Tile.jpg Show the two windows above each other

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 has no effect on the comparison of binary files.

Binary

Compares in binary mode, i.e. fixed line width, hexadecimal display.

Unicode

Compares in unicode mode (UTF-16).

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 add the following line to your wincmd.ini under section:

[Configuration]

CompareIgnoreRepSpace=0


The following shortcuts work in this window:
Insert select line
Ctrl+C, Ctrl+Insert Copy selected text
Shift+F10, Menu key Show context menu
Left/Right arrow Scroll by 1 character
Alt+Left/Right arrow Scroll by 30 characters
ESC Close dialog
F7 Search
F3 Continue search


Compare by content with FTP

Special considerations are found when trying to use the feature for FTP server connections (since 6.52).

  • "IBM MVS (Z/OS) Server considerations when using Compare by content"

Feature does not work with IBM MVS naming conventions. 501 Invalid data set name "0:'ABCD.EFGH'\XYZ". Use MVS Dsname conventions. will occur and can not be corrected. So you have to do a workaround like (F3 view) and compare the tempfile instead. Leaving sessions say - close Listerwindow - will delete the workfiles like implicit upload would do.


Back to List of internal functions