When comparing two documents one finds the differences and makes a conclusion. What if there are differences that are not significant for the comparison? For example:
- Developer’s comments in the source code are important, but they don’t affect code execution.
- Different date and time stamps in the end of each page will be highlighted as a difference, but they are not an important part of the document content.
- Some words that are synonymic for the human eye will be highlighted as being different.
With Compare Suite PRO users can manage these situations by specifying proper settings for ignoring certain items.
Ignoring in Compare Suite
To access “Ignoring” settings in Compare Suite go to the Tools > Options > Ignoring.
Let’s review shortly the options available there:
- Line ignoring. The first text box is for the strings that need to be ignored. For example, record “Date time * {0}” in this list will tell Compare Suite that the line that contains “Date time” need to be ignored. Parameter between { and } shows if user wants to ignore the line where the mentioned “Date time” marker was found (in this case we use {0}), or for example, the next line (in this case we’d use {1}).
- Words ignoring. The next text box is for the words that will be ignored. What does it mean? If for example in the left document you have “company” and in the right file you have “corporation,” then you can add “company” word (or “corporation” word) into word ignore list and Compare Suite won’t mark the difference as a difference.
- Ignore comments. The next check box is “Ignore comments in source files (C++, C#, PHP, Java, Delphi).” It does what it says. It will be able to ignore commented lines (the text after // ) as well as commented blocks (the program recognizes blocks of /* … */ in C++ files and { … } in .pas files). Function will work only if you compare files with original extensions (e.g. .cpp or .pas).
Ignoring date and time stamps
As was mentioned before, this feature helps to ignore lines that are not important for the comparison. For example, each page of your document might include date and time information about when this document was created.
It is obvious, that two documents will have different creation times and it doesn’t make any sense to show those differences and distract a user’s attention from more important differences. The solution is to determine some repeating pattern and ignore it.
For example, your document might look like:
Line 1
Line 2
Line 3
Author: Bob
Modified:
2nd September, 2014 12:31:34
Line 1 – 3 is where the key information is. A document might be edited by different authors and for sure will have different modification time. You might want to ignore these changes and focus on Line 1 – 3. To do this go to the ignoring options and add there:
- Author: * {0} (in this way we tell Compare Suite to ignore line that starts with Author:)
- Modified: * {1} (in this way we tell Compare Suite to ignore the 1st line that goes after “Modified:”
Ignoring words
Application of this feature is not that obvious but sometimes it really helps to deal with synonymic names. For example, you can add in the list “company,” and “firm.” In this Case Compare Suite won’t mark the between this two sentences:
- Our client is a company from the US
- Our client is a firm from the US
Probably, this is a feature that legal specialists will never use. At the same time, those who needs to filter quickly unimportant changes, will find it really useful.
There is a trick: switch your comparison to the “By keywords” mode. You’ll see that Compare Suite supports word ignoring during “By keywords” comparison as well. In this way you might be having more accurate statistics about the differences.
Ignoring developer’s comments in C++, C#, PHP, Java, Delphi files
The mentioned check box does what it name says – it will ignore comments in the source code. Good thing is that it can handle comments of one line (software developers normally use // for this purpose), and it can ignore the whole blocks of comments like (/* … */ in C++ and similar, or {…} in Pascal).
For example, these two lines:
- a=b*c; // getting a value
- a=b*c; // calculating a value
will be shown as equal, as Compare Suite will ignore the text in the comments. The same applies to the blocks of comments.
- This ignoring feature together with syntax highlighting makes Compare Suite a must-have tool for the comparison of source codes.
One important note: Compare Suite detects file format by the file extension. So, if you will save your .pas file into .txt file, then Compare Suite won’t be able to process it as Pascal source code file. Keep an original extension and everything will work perfectly!
Ignored lines in the report
A good question is, “How do I know about the lines that were ignored?” Compare Suite ignores the lines, but still one might need to review the lines that were ignored.
Compare Suite uses a yellow color for the ignored lines. It will mark with yellow the text that was ignored text both in program interface and in the reports.
How our customers used line ignoring
Here are some examples of how our customers applied ignoring feature.
We are using the features of Comparing Folders, Ignore Line option (not ignore by keywords), XML Comparing (XML is not Sorted but Compare Suite sorts it before comparing) and using command line calls. Let’s review these features in the details and give some specific examples. Read more…
Paul Geraci, Analyst Programmer, Friends First Holdings Ltd, Ireland
The comparison options are highly configurable. For example, you can set up a list of keywords that will be ignored during the file comparison or you can configure the fonts and colors used to highlight added, deleted or modified words or files. Read more…
Anthony Frend, Scientific Support Analyst, HLS, Huntingdon, UK
Do you have any questions or your own case to share? Feel free to share it via comments.
Leave a Reply
You must be logged in to post a comment.