Announcement

Collapse
No announcement yet.

Leading Zeros

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

  • Leading Zeros

    Is there a way to set up a rule to ignore leading zeros

    0.232

    vs

    .232

    for Example

  • #2
    Possibly. You could set up a grammar item for numbers that doesn't include leading 0's and then another grammar item to match just the 0's and then ignore them. It will be more complicated if you're trying to modify one of our default file formats with an existing grammar.

    * Load the files in the text compare.
    * Click the "Format" button on the toolbar (Paper with a Gear).
    * Switch to the "Grammar" tab.
    * Click "New...".
    * In the new dialog
    - Change the "Element name" to "Number".
    - In the "Text matching:" edit enter "([1-9]+(\.[0-9]*)?|\.[0-9]*" without quotes.
    - Check the "Regular expression" checkbox.
    - Click OK.
    * Click "New..." again.
    * In the new dialog
    - In the "Element Name" edit type "Leading zeros"
    - In the "Text matching:" edit enter "0+".
    - Check the "Regular expression" checkbox.
    - Click OK.
    * Click OK.
    * Click the "Rules" button on the toolbar (Umpire).
    * Uncheck the checkbox next to "Leading zeros" in the "Grammar elements" list.
    * (Optional) Change the combobox at the bottom of the dialog from "Use for this view only" to "Update session defaults".
    Zoë P Scooter Software

    Comment


    • #3
      Originally posted by Craig View Post
      Possibly. You could set up a grammar item for numbers that doesn't include leading 0's and then another grammar item to match just the 0's and then ignore them. It will be more complicated if you're trying to modify one of our default file formats with an existing grammar.

      * Load the files in the text compare.
      * Click the "Format" button on the toolbar (Paper with a Gear).
      * Switch to the "Grammar" tab.
      * Click "New...".
      * In the new dialog
      - Change the "Element name" to "Number".
      - In the "Text matching:" edit enter "([1-9]+(\.[0-9]*)?|\.[0-9]*" without quotes.
      - Check the "Regular expression" checkbox.
      - Click OK.
      * Click "New..." again.
      * In the new dialog
      - In the "Element Name" edit type "Leading zeros"
      - In the "Text matching:" edit enter "0+".
      - Check the "Regular expression" checkbox.
      - Click OK.
      * Click OK.
      * Click the "Rules" button on the toolbar (Umpire).
      * Uncheck the checkbox next to "Leading zeros" in the "Grammar elements" list.
      * (Optional) Change the combobox at the bottom of the dialog from "Use for this view only" to "Update session defaults".
      In addition to this question I have another one.
      How can I filter out any numbers with the same value?

      Example:
      10.0 has same value as 10
      12.50 has same value as 12.5

      For hex values:
      0x0 is same as 0X0000

      Comment


      • #4
        Hello,

        The Text Compare does not have the concept of values. You can define specific text strings to match others, but we do not have an option to match and treat as a numeric. We do have this option in the Data Compare, if your files are delimited information that can be viewed in a table (rows/columns). A Numeric column would find and treat numbers based on their value.
        Aaron P Scooter Software

        Comment


        • #5
          OK thanks.

          Comment

          Working...
          X