Announcement

Collapse
No announcement yet.

How to ignore first few chars of line.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to ignore first few chars of line.

    My current version is 3.1.2.
    I had a rule on my old laptop where I could exclude or ignore the first chars of a line.
    Specifically I have numbered lines as shown in the sample but the numbers might not line up.
    When the first Char is N, I want to ignore any numeric chars after it until we come to a non-numeric character.

    ....sample text.....
    N245 G00 X2619.660 Y244.388 M40
    N246 G01 X2619.660 Y256.388
    N247 G01 X2623.710 Y256.388
    N248 G01 X2624.498 Y256.163
    N249 G01 X2625.172 Y255.713
    ....end sample text.....


    I found the session.bcse file and I see the rule but I do not know how to recreate it in the new software.

    ExcludeAttribSizeFilterModeCriteriaDisplaySortByC ols’n395s90t130

    Any help is appreciated.
    Kevin
    Last edited by BCUser99; 28-Jan-2011, 11:39 AM.

  • #2
    I think I figured it out. I am using this text as the text matching string of the Grammar Element:

    ^[N]+\d+\d+\d

    It seems to work (marked as unimportant) although there must be a better way to ignore the number string whether it has 2 chars or 3 or 4.
    Can I do that?

    Kevin

    Comment


    • #3
      Hello,

      The KB article for the subject of defining grammar and marking them as Unimportant is found 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.


      From your example above, would using a Basic grammar type:
      ^[N]\d+

      work for you?
      Aaron P Scooter Software

      Comment


      • #4
        Aaron,
        Thanks for your help,
        I had found that page and watched that video earlier. it helped.

        Your ^[N]\d+ worked fine for me.
        Thank you,
        Kevin

        Comment


        • #5
          Hello,

          You're welcome. That regEx is designed as:
          ^ = beginning of line
          [N] = matching on the set including N
          \d+ = at least 1, or more, digits (numerals).
          Aaron P Scooter Software

          Comment

          Working...
          X