No announcement yet.

how to Ignore line numbers

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to Ignore line numbers


    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
    comparing 2 .mcd code files - how to ignore line numbers


    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 Files


    • #3

      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:
      Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.
      Aaron P Scooter Software


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


        • #5
          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
            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
              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:

              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:

              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
                Awesome, that ^N\d+ worked perfectly.

                Greatly appreciated Aaron