Results 1 to 4 of 4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2018
    Posts
    2

    Default Unable to ignore 4th decimal place characters

    Hello,
    I am comparing 2 large files mostly made up of 4 decimal place numbers.
    There are tons of insignificant differences in the 4th decimal numeral of many of these numbers which I'd like to filter out.
    Please see image attached for more info.

    I would like to ignore the 4th character after every decimal in the file.

    What script syntax could I use for a Grammar Item to filter out text differences like this?

    Thanks
    Dave
    Attached Images Attached Images

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

    Default

    Hello,

    Are there only 4 decimal places as a constant factor? Or is the length variable? What does the other side look like?

    Text does not get treated as a numeric value in the Text Compare, so there is no way to ignore a numeric tolerance. The Text Replacements could be defined using fairly extensive rules, but any variance in length would break it. Or a general Unimportance rule for "\d " (including a trailing space), which would ignore the last numeric character (regardless of where it is). Including "\d$" to catch the last number on a line.
    Aaron P Scooter Software

  3. #3
    Join Date
    Feb 2018
    Posts
    2

    Default

    Yes, the 4 decimal places is constant. There could be up to 5 of these numbers in a line, separated by a letter and a space (See attached
    Attached Images Attached Images

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

    Default

    Well, if it is that consistent, does the method of using the Session menu -> Session Settings, Importance tab, and define two Unimportant rules for:
    \d
    (with trailing space)
    and
    \d$
    as regular expressions work for catching these differences?

    If so, you can define something as part of the format rather than session following this guide:
    http://www.scootersoftware.com/suppo..._unimportantv3


    For something more specific, you can define a Session Setting -> Replacement as:
    (\d)(\d)(\d)\d
    with
    $1$2$3\1
    Regular Expression. And another:
    (\d)(\d)(\d)\d
    with
    $1$2$3\2

    where the last \1, \2, etc is defined for each digit up to 9 and 0.
    Aaron P 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
  •