Results 1 to 3 of 3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2017
    Posts
    2

    Default Ignore small decimal differences

    I compare two files that contain small difference in decimal part of numbers, due to rounding a number 109927.77777777 in one file is represented in another file as 109927.77777778 but i would like to ignore such small differences. I would appreciate if some of you could share an idea of how this can be acomplished.

    File2:
    Volume = 113111.11111112 127422.22222222 113497.22222222 106088.37888889 109927.77777777 106419.00444444 106419.44444444

    File1:
    Volume = 113111.11111112 127422.22222222 113497.22222222 106088.37888888 109927.77777778 106419.00444445 106419.44444445

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,376

    Default

    Hello,

    If your data can be delimited and viewed in the Table Compare session type, each Numeric column can have an associated Numeric Tolerance to ignore a change like this.

    In the Text Compare session, the characters are just text (not a number), so ignoring it is a bit trickier. We'd have to create a grammar that matches on this spot of the line. I'd recommend defining a grammar for the Important part of the number:
    \d+\.\d{5}
    where "5" is the number of characters after the decimal that are important.

    Then in the Text Compare, Session Settings, Importance tab, you can check this new grammar's name, and uncheck Everything Else. This will make this part of the number important, and everything else on the line unimportant. If you need to define additional grammars (for "Volume =" or other text), these can also be Important.
    Aaron P Scooter Software

  3. #3
    Join Date
    Dec 2017
    Posts
    2

    Default

    Thanks a lot for your help, Aaron!

Posting Permissions

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