Ignoring differences in date time when comparing files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steveculshaw
    Expert
    • Sep 2009
    • 73

    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 ...
    e.g.

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

    File 2
    09:52:34.6264430 COLLECT PROCESS START...
  • Aaron
    Team Scooter
    • Oct 2007
    • 16017

    #2
    Hello,

    By defining a specific regular expression grammar, then mark that grammar as Unimportant. See here for a detailed article and video:
    http://www.scootersoftware.com/suppo..._unimportantv3

    The above example could work with a new "timestamp" grammar element (with Regular Expression enabled):
    \d\d:\d\d:\d\d\.\d{7}
    Aaron P Scooter Software

    Comment

    • misi01
      Old Hand
      • Jun 2005
      • 210

      #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)
      *COLLECT PROCESS START*
      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)

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16017

        #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

        Comment

        • steveculshaw
          Expert
          • Sep 2009
          • 73

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

          Comment

          Working...