Results 1 to 2 of 2
  1. #1
    Join Date
    May 2016
    Posts
    1

    Default Possible to ignore part of a line?

    I'm comparing two text files. I need to ignore part of a line and I've looked through the KB article on defining grammar parts and marking them unimportant by de-selecting them. I can't get this to work and before I waste too much time I want to make sure what I'm trying to do is possible.

    Let's say I have two lines in two different files:

    File 1: dim x as integer = 8
    File 2: dim x_v_1_3 as integer = 8

    what I want to do is to ignore anything of the format _v_\d_\d
    This text is a version number that I don't care about, and it will always be in the format _v_#_#.

    So, if I have
    File 1: dim x as integer = 8
    File 2: dim x_v_1_3 as integer = 8

    These should be considered the same. But if I have:

    File 1: dim x as integer = 8
    File 2: dim x_v_1_3 as integer = 9

    These should be considered different because something other than the _v_#_# is different.

    Is this possible, to ignore just part of a line?

    Thanks

    Rob

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    Yes, and the Regular Expression you have should work (I just tested it out given this example). When you defined the grammar, type Basic, did you enable the Regular Expression option?

    Then, in the Session Settings of the Text Compare, Importance tab, uncheck your grammar element name. In the main view, does this cause your text to become blue or black (instead of red)? That indicates the grammar is correct; you can then set it to black with the Ignore Unimportant Differences toggle in the toolbar.
    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
  •