No announcement yet.

How to ignore an entire line based on an expression

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to ignore an entire line based on an expression

    I would like to ignore an entire line based on an identifier like LO51 or TL51. The lines in question will always have differences, but these differences are not predictable, etc., and because they orruc in every set of records, the difference identififcation is skewed and hard to read. In the meantime, I have created a Grammar Element to ignore differnces in certain columns in these lines, but the down side is that this is applied to all rows, which could cause me to miss an important difference.


    Thank you for your help.


  • #2
    See the "Define Unimportant Text in Beyond Compare" article on our website:

    Instead of marking text unimportant by column range, you can mark text unimportant using delimiters (match on text L051 to end of line) or using a regular expression.

    Example regular expression:

    The ^ matches on the beginning of a line.
    The . matches on one of any character.
    The * matches on zero or more of the preceding character.

    If you continue to have trouble marking unimportant text, send a pair of example files to [email protected] and we'll provide more specific instructions.
    Chris K Scooter Software


    • #3
      I too am having trouble getting this to work as I expect it to. I'm making changes to files, but have first made a copy of the files/folders so that I can go back and find what I've changed. There are changes that I need to make within files so that I can compile them, but I don't want to see these changes in BC3. I was using the tag "//BC_SKIP" at the end of these lines and trying to filter out these line changes using the unimportant text as the article on the website states: "BeyondCompareSkip=Text matching ^.#//BC_SKIP$". I just won't use this end of line tag for the changes that I actually do want to see in BC3. As an example, a line in the original file is: "class.init()". I have changed my file copy to: "class.Init() //BC_SKIP". This only works for the modified file that has the //BC_SKIP tag. The original file still shows Red lines while my modified file lines can toggle from Blue to Black with ignore unimportant differences option. Also in the folder comparison both files always show as Red even though in comparison settings I only have "Compare contents: Rules-based comparison" checked and I have opened the file. It does seem to skip the quick compare and open all the files, because it does take a few minutes to do a complete refresh (Ctrl+F5). I was hoping not to have to add the //BC_SKIP tag in the original files as well. Any help is greatly appreciated.


      • #4

        First, for the Rules-based compare to mark files as Unimportant, the entire file needs to be unimportant by default. To verify, you can double click and view the file, and if it is entirely blue without changing any configuration, then a rules-based scan would return these same results. If a session setting change is needed, then we'd need to change the default configuration.

        The grammar does not mark both sides as unimportant if the grammar matches on one side. Each side is independently applying a format (or both using the same format, as is most often the case), which then applies that format's grammar definitions to the text. If the grammar is then unimportant, that specific text is then unimportant. If an unimportant element is aligned to an important element, and there is a difference, then that difference would be Important on the important side and Unimportant on the other unimportant side.
        Aaron P Scooter Software


        • #5
          OK I see. I would need to put the tag in both the original and modified file lines. I don't want to do that. One work-around would be to generate the file difference reports and post process this to eliminate tagged lines. Thanks for your quick response.