Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    1

    Question 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?

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    7,603

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •