How to ignore date and time in a text file when comparing text files ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jasoncwlee
    New User
    • Apr 2018
    • 2

    How to ignore date and time in a text file when comparing text files ?

    I try to ignore this 20 Apr 2018 05:42:00,682 using this grammar rule ^\d{2}\s{1}\D{3}\s{1}\d{4}\s{1}\d{2}:\d{2}:\d{2},\ d{3} but does not work.

    Thanks
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    You have an extra space in the last '\ d{3}', it should be '\d{3}'.

    Another regular expression that will also work is: ^\d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2},\d{3}

    If you're defining it as a grammar element in a file format, make sure you also uncheck the grammar element name in the Importance tab of Session > Session Settings (Rules toolbar button).
    Chris K Scooter Software

    Comment

    • jasoncwlee
      New User
      • Apr 2018
      • 2

      #3
      Thanks!

      Comment

      Working...