Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2012
    Posts
    12

    Question About grammar settings to ignore one more strings in same line

    Hi,

    I met a problem to set the grammar to ignore one more strings in same line, for example for below strings:

    0004 SDR Full 01 01 20 a 02 snum 13 CPU0_VCCSA = 88 OK 0.88 Volts
    0005 SDR Full 01 01 20 a 02 snum 14 CPU0_VPP = bf Init 1.80 Volts
    0006 SDR Full 01 01 20 a 02 snum 1a PCH_1.05VS = 5f FAIL 0.93 Volts
    0007 SDR Full 01 01 20 a 02 snum 1b PCH_VNN_SBY = b9 NS 1.81 Volts

    I'd like to ignore above red marked characters/locations, note that for the first red marked character in above each line it could be two numeric combined i.e. 88, or one numeric with one non-numeric combined i.e. 5f or b9, or even with two non-numeric combined i.e. bf.

    I have successfully to ignore the 2nd red marked character(0.88/1.80/0.93/1.81) which is pure numeric by below grammar:

    .\d*.\d*\sVolts

    (attach file is an example)

    But I don't know how to add the first red marked character into the grammar, because I want the 'OK/Init/FAIL/NS' character/location which is after the first red marked character can not be ignored(exclude in the grammar).

    And, the same rule for the line which is with 'degree C' character in the end of the line, i.e.:

    0015 SDR Full 01 01 20 a 01 snum 44 BBU Temp = 00 Init 0.00 degrees C
    0016 SDR Full 01 01 20 a 01 snum 50 CPU0_DIMM Temp = 00 OK 0.00 degrees C

    Please help and thanks in advanced!

    Jacky
    Attached Files Attached Files
    Last edited by lasthero; 19-Sep-2018 at 12:16 AM.

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,790

    Default

    It isn't possible to match with a single regular expression while still including differences in between the two numeric or hex values.

    Here are three regular expressions that might work for your files:

    \d\.\d\d Volts
    \d\.\d\d\ degrees C
    = [\da-f]{2}
    Chris K Scooter Software

  3. #3
    Join Date
    Nov 2012
    Posts
    12

    Default

    Quote Originally Posted by Chris View Post
    It isn't possible to match with a single regular expression while still including differences in between the two numeric or hex values.

    Here are three regular expressions that might work for your files:

    \d\.\d\d Volts
    \d\.\d\d\ degrees C
    = [\da-f]{2}

    Thanks, Chris.

    Please consider to implement the feature which can ignore two different strings in single line, it can be by adding ‘&’ to separate two strings, i.e.:

    =\s[\da-f]{2}&\d.\d\d\sVolts
    =\s[\da-f]{2}&\d.\d\d\sdegree\sC

    Because I need to ignore it on the line which end of ‘Volts’ and ‘degree C’, if I add it separately like your suggestion:

    \d\.\d\d Volts
    \d\.\d\d\ degrees C
    = [\da-f]{2}

    On the last one(= [\da-f]{2}) it will be applied to the lines which the end is not with ‘Volts’ and ‘degree C’, so I hope it can be implemented in new build of BC.

    Thanks,
    Jacky
    Last edited by lasthero; 19-Sep-2018 at 03:47 PM.

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,790

    Default

    Thanks for the suggestion, I'll add it to our feature request list.
    Chris K Scooter Software

Posting Permissions

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