Announcement

Collapse
No announcement yet.

Help with a Rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Help with a Rule

    Hello,

    I need help with a Rule. What is the best way for me to do the following.

    I have the data below. I need a rule that says this is unimportant: ignore as unimportant any row that starts with 37 and has differences in rows 8 to 23. These are time stamps that will change often.


    37000002009081220100810HMS1

    I have gotten it to work by creating a Grammer item named Comment37b that looks like this.

    Comment37b=Text matching ^37.*
    Comment37b=Column from 8 to 23.

    It looks like I am getting an 'AND' out of this, but have not found any documention to verify it. Is this the correct way to do it? OR is there a better way?

    Thanks!

  • #2
    I don't know how you would define a grammar that skips characters in the middle of a string. You could use a single basic regular expression to define the entire field:

    ^37.{21}

    The {21} would say to include 21 characters after the initial "37" (which would include columns 8 through 23 but would also include columns 3 through 7). In other words, I can't think of a way to omit columns 3 through 7 from the grammar element.
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment


    • #3
      Creating two grammar items does not link the grammar item. It is a way to label the grammar item as part of a larger set. For example, we have String definitions that match " to " and ' to '. Either is a String, and both are marked as Unimportant if String is Unimportant.

      It sounds like the 37 itself dictates that part of the text is important, and part of it is unimportant. You could create a single grammar item that is ^37.{5} and mark that as Important. Then mark Everything Else text as Unimportant. We do not have a method to skip text in the middle or to reference back to the 37 at the beginning of the line.
      Aaron P Scooter Software

      Comment


      • #4
        Thanks. After further testing, I did realize that it wasn't working the way that I had thougth. I also found in the help file where it said that BC doesn't do contextual compares. I guess I will have to find another way or another tool.

        Thanks again for your help.

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎