How to ignore line numbers in text files
Tutorial Description: Sometimes you may need to compare files with line numbers. This tutorial will cover how to remove line numbers from comparison.
Example: You will be using a correctly formatted version of Jakob Nielsen's The Top Ten Mistakes of Web Design, as well as a version that has all the line numbers switched around. For your convenience, the lists have already been formatted for this tutorial: download top10mistakes_correct.txt into a new file named top10mistakes_correct.txt, and top10mistakes_wrong.txt into a new file named top10mistakes_wrong.txt.
- Open ExamDiff Pro and compare top10mistakes_correct.txt to top10mistakes_wrong.txt.
- Uh-oh. Something is wrong here. The mixed-up line numbers are making
ExamDiff Pro think that the files are completely different.
- Click View | Options.... (or press Ctrl + J) and go to the
Compare sub-menu. Click on the Parts matching regular expressions
radio button. In the text box near where it says Parts matching regular expressions,
write "^\d+" (without the quotes).
- Click OK to leave the Options page and click Yes on the "Some comparison options have
changed. Would you like to re-compare now?" dialog.
- Another dialog appears, saying "Identical Files." Click on Show Anyway.
- As you can see, the line numbers have been ignored.
Conclusion: Regular expression support makes ExamDiff Pro a very powerful file comparison tool. To learn more about using regular expression in the application visit this Online Help page.