PDA

View Full Version : How to ignore first few chars of line.


BCUser99
28-Jan-2011, 08:02 AM
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

BCUser99
28-Jan-2011, 10:18 AM
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

Aaron
28-Jan-2011, 01:58 PM
Hello,

The KB article for the subject of defining grammar and marking them as Unimportant is found here:
http://www.scootersoftware.com/support.php?zz=kb_unimportantv3

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

work for you?

BCUser99
28-Jan-2011, 02:09 PM
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

Aaron
01-Feb-2011, 02:00 PM
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).