Extra|Compare Files

(available in EditPad Pro only)

If you have two versions of the same text file, you can use Extra|Compare Files to visualize the differences between those files. After that, you can edit the generated difference file to merge both versions into a single, new file.

First you need to open the two files you want to compare. The Extra|Compare Files menu item is grayed out until you have two or more files open.

Selecting Files

To compare the files, first activate the file that contains the original or older version of the document by clicking on its tab. Then select Extra|Compare Files from the menu. In the window that appears, click on the file that contains the newer version of the document, in the list of files that are currently open. The active file is omitted from that list, since you cannot compare a file with itself.

The file that was active at the time you selected Extra|Compare Files in the menu is considered to be the “old” file. The file that you select in the file comparison options screen is considered to be the “new” file.

How to Compare The Files

You can specify several options when comparing files. The setting for the minimum match size may have a significant impact on the comparison. It is explained in detail in its own topic. 3 is a good default value.

You can choose to ignore differences in leading spaces and tabs. That is, when comparing two lines, EditPad Pro ignores any space and tab characters at the start of the lines. Similarly, you can choose to ignore trailing spaces and tabs. That is, spaces and tabs at the end of a line. You can mark both options to ignore both leading and trailing spaces and tabs. If you mark “ignore all differences in spaces and tabs”, then EditPad Pro ignores all spaces and tabs throughout both files when comparing their lines. These options are useful when comparing files where differences in whitespace have little or no meaning.

If you turn on “ignore added and removed blank lines”, EditPad Pro does not add blank lines that occur only in one of the two compared files to any new file created by the file comparison. Those lines are also not highlighted in the original files. Lines with only spaces and tabs are considered to be blank only if you’ve turned on one of the options to ignore differences in spaces and tabs.

Finally, “ignore differences in case” tells EditPad Pro to ignore whether a character is uppercase or lowercase, making “A” identical to “a”.

What to Display

If you select to highlight changes in the original files, EditPad Pro marks lines present in the “old” or “original” file in red when they are not present in the “new” or “edited” file. It also marks lines in the “new” file in green when they are not present in the “old” file. You can change these colors by customizing the color palette and editing the “Editor: Compare files: deleted line” and “Editor: Compare files: added line” colors.

If you turn on “new file with fully merged contents” then EditPad Pro creates a new tab with the two files merged, based on their differences. The tab is labeled “OldFile compared with NewFile”. Lines that are the same in both files are added once and displayed on a normal background. Lines only present in the “old” file are added on a red background. Lines only present in the “new” file are added on a green background. If the text on a line was changed between the “old” and “new” versions of the file then EditPad Pro first adds the old version of the line on a red background. After that it adds the new version of the line on a green background. If consecutive lines were changed then EditPad Pro first adds a block with the old versions of all the consecutive lines. After that it adds a block with the new versions of the consecutive lines.

“New file with removed and added lines” is the same as “new file with fully merged contents”, except that lines present in both the “old” and “new” files are not added. Thus all lines in this file are highlighted red and green. Consecutive changed lines are grouped in the same way. The tab is labeled “Differences between OldFile and NewFile”.

“New file with removed lines only” contains a tab with lines that are present in the “old” file, but not in the “new” file. Since all lines are old lines, none of them are highlighted. The tab’s label is “Lines from OldFile removed in NewFile”.

Similarly, “new files with added lines only” creates a tab labeled “Lines not in OldFile added to NewFile” with lines present in the “new” file, but not in the “old” file.

Finally, “new file with unchanged lines only” creates a tab labeled “Lines unchanged between OldFile and NewFile”. This tab shows all the lines present in both files.

All new tabs with difference output behave like regular files in EditPad Pro. You can use any editing command on them and save them for later use. The History panel can remind you of the two files that were compared. It shows you which was the “old” or “original” file and which was the “new” or “edited” file along with their color indicators.

See Also

Extra menu
Minimum number of lines for matching block
Extra|Compare with File on Disk
Extra|Next Comparison Mark
Extra|Previous Comparison Mark
Extra|Clear Comparison Marks
View|File History