Unable to ignore 4th decimal place characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WestCoastDave
    New User
    • Feb 2018
    • 2

    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 Files
  • Aaron
    Team Scooter
    • Oct 2007
    • 15945

    #2
    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

    Comment

    • WestCoastDave
      New User
      • Feb 2018
      • 2

      #3
      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 Files

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15945

        #4
        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

        Comment

        Working...