No announcement yet.

Ignoring differences in date time when comparing files?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ignoring differences in date time when comparing files?

    Is it possible to ignore differences in date times when comparing files?

    In this case I've got sets of log files where the start of the line has the date/time ...

    File 1
    17:51:25.0891243 COLLECT PROCESS START...

    File 2
    09:52:34.6264430 COLLECT PROCESS START...

  • #2

    By defining a specific regular expression grammar, then mark that grammar as Unimportant. See here for a detailed article and video:

    The above example could work with a new "timestamp" grammar element (with Regular Expression enabled):
    Aaron P Scooter Software


    • #3
      I know this is old, but I'm going to append here as well as appending a similar query. This concept of grammar rules and unimportant text is probably not quite as easy as you think.

      My question on your soluion Aaron. Would it not be easier to define the grammer as being something like (if I've misunderstood the online help, then this "proves" that it's not easy)
      My interpretation of what the above is supposed to do from the online help is "define a grammer rule for ANY line containing the string COLLECT PROCESS START anywhere on the line" and then mark this as being unimportant

      If this were to work, isn't this easier to express ? (I have to be honest, reading your solution leaves me scratching my head)


      • #4
        The original post includes 2 example lines, but the description only mentions "Is it possible to ignore differences in date times when comparing files?"

        Therefore, I didn't assume it could be specific to only ignoring lines with COLLECT PROCESS, but a definition to match any line that Begins with a Timestamp. The Regular Expression in the example matches on the timestamp pattern of the two example lines.

        If the request was to ignore any line that has COLLECT PROCESS anywhere within it, then you could create a mask similar to the one you've defined, and is easier to express since that text is static, unlike the changing timestamp.
        Aaron P Scooter Software


        • #5
          Aaron ... yeap, correct. I was only interested in handling the date/time difference