Ignore line if one file contains certain text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • purdueucompe
    New User
    • Mar 2009
    • 1

    Ignore line if one file contains certain text

    Is it possible for me to set up a regular expression to ignore an entire line when certain text exists in one of the files? For instance,

    File1, line X:
    char* myString;

    File2, line X:
    TCHAR* myString; // UNICODE_CONVERSION

    Clearly the lines differ, but I want to ignore this line because it is marked as UNICODE_CONVERSION. Adding unimportant text of ".*UNICODE_CONVERSION.*" doesn't seem to be working. Any suggestions?
  • Aaron
    Team Scooter
    • Oct 2007
    • 15941

    #2
    Hello,

    .*UNICODE_CONVERSION.* should mark that entire line of file2 as Unimportant (Blue) text, which can then be ignored by toggling on Ignore Unimportant Differences. The line in file1 will still be an Important difference, however. You would need to define the line in file1 as unimportant text as well, but then it will not so differences if aligned to something different; you will have to look at the other pane.

    Beyond Compare 3 includes a new feature called Text Replacements, which allows you to define the Left side as "char* myString;" as equivalent to the right side as "TCHAR* myString; // UNICODE_CONVERSION". They will then only be equal if the left and right side match in that specific way.

    You can install the BC3 trial without uninstalling BC2. By default, they install to separate directories and can be used on the same computer.
    http://www.scootersoftware.com/download.php
    Text Replacements is a Pro feature.
    Aaron P Scooter Software

    Comment

    Working...