Results 1 to 8 of 8

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2017
    Posts
    6

    Default how to Ignore line numbers

    Hello,

    I've been trying to work on ignoring line numbers between 2 documents. I'll show an example below of what I'm trying to make not important inside of the rules of BC:

    Post 1:
    N6123 X.1234 Y.4321 Z.100
    N6124 X.1234 Y.4321 Z.100
    N6125 X.1234 Y.4321 Z.100
    N6126 X.1234 Y.4321 Z.100

    Post 2:
    N6125 X.1234 Y.4321 Z.100
    N6126 X.1234 Y.4321 Z.100
    N6127 X.1234 Y.4321 Z.100
    N6128 X.1234 Y.4321 Z.100

    I would like BC to ignore the underlined line numbers of the code between these two posts, but still compare the follow on code after the 'N' number is shown

    Any help greatly appreciated

  2. #2
    Join Date
    Jul 2017
    Posts
    6

    Default comparing 2 .mcd code files - how to ignore line numbers

    Hello,

    Thought I had created a post earlier, but nothing seems to be in the new thread with my post. Apologies if I'm just anxious to get an answer and this is a double post.

    How do I ignore line numbers on 2 sets of code, where everything else matches except for the line number.

    See attachment for example

    Thank you for any assistance
    Attached Images Attached Images

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,376

    Default

    Hello,

    No problem. Your first post needed approval before being visible to help control spam.

    You would want to define a grammar for your Line Number, and then mark that grammar as Unimportant. Then toggle Ignore Unimportant Differences in the Text Compare toolbar as needed (and use a Rules-based scan in the Folder Compare) to use/hide these differences.

    We have a KB article and video, here:
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

  4. #4
    Join Date
    Jul 2017
    Posts
    6

    Default

    Thanks aaron for the quick response, i'll look over the article

  5. #5
    Join Date
    Jul 2017
    Posts
    6

    Default

    Guess I've looked over the article you referred to and I have watched that video, but still have questions regarding how I create text or a grammar code that matches what I'm trying to ignore. His video showed to ignore dates and had a string of text showing all of the date values, but what would I put down to ignore just the 'N' numbers at the beginning? I tried columns before but don't want to ignore other parts of code before the line numbers are shown, I just want to make the 'N' numbers that can range from 1-999999 in the post to not be important. Any guidance for what to put into the grammar or what you think this would be considered? (i.e. when you are creating the new grammar you have basic, delimited, list, columns, lines)? Thanks again

  6. #6
    Join Date
    Jul 2017
    Posts
    6

    Default

    I've watched that video and read that article before, but guess it didn't really explain very well how to callout the 'N' line I'm wanting to ignore. Inside the video he pasted some sort of long code inside of his grammar to ignore the dates, but I have no idea what I would put in to just ignore the N number. Any further assistance would be appreciated.

    And again I have just replied to this 2 other times, but nothing showed up. Didn't realize every post would be looked over before posting if that is the case that my other couple replies haven't showed yet. Apologies again, just getting used to how your forum operates.

  7. #7
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,376

    Default

    The script that does approval is not instantaneous. You don't need to worry: we can see your posts.

    For an example of Line Numbers, you may want to look at the built in COBOL source format, which has a line number defined as:
    ^\d{6}

    For you, I would recommend creating a new format in the Tools menu -> File Formats, click '+' new Text format. Assign the new format your file extension ("*.ext")

    Then in the grammar tab of this new Text format, create a new Basic format, and enable "Regular Expression". Give the format a custom Element name: either "Line Number" or "Custom Line Number Name".
    A regular expression that would probably match on your text is:
    ^N\d+

    Then in the Text Compare, Session menu -> Session Settings, Importance tab, uncheck your element name to make it Unimportant (checked items are Important/red). This can be done for just this view or update the global defaults (from this dialog's dropdown, or on the main Home screen, in the saved Sessions list, New folder: Text Compare).

    Once unchecked, Unimportant differences are Blue, or ignored/black if you enable the Ignore Unimportant Differences toggle in the toolbar of the Text Compare.

    Quick summary: define the grammar element in a file format that your files use, uncheck the element name in the Session Settings, and enable Ignore Unimportant Differences.
    Aaron P Scooter Software

  8. #8
    Join Date
    Jul 2017
    Posts
    6

    Default

    Awesome, that ^N\d+ worked perfectly.

    Greatly appreciated Aaron

Posting Permissions

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