I am trying to compare 2 text files which contains lines with a format like the one below:
(Prefix) (Fixed Text) (Variable timestamp)
The format of each of these items is very easy to define as a regex.
I want to mark as unimportant the lines having the same (Prefix) (Fixed Text) yet different timestamps.
Using grammar, I was able to achieve this, but is requires a new grammar for each prefix. I created a grammar for Prefix1, Prefix2, Prefix3... and it works really well. The problem is that I have several different prefixes and I would prefer no to enter them manually.
Creating grarmmar element with a regex for the prefix would result in considering that Prefix1 vs Prefix2 is uninmportant, which is not the case.
If I undestand replacements, correctly, it allows to define rules to replace some defined string/pattern in one file, and after the replacement, match that with the content of the other file. Given that the content of the timestamp changes, there is no way to write a rule that will transform the original line in the final one.
Another option would be to create an external program to replace the timestamp by a series of identical characters.
Is there any way to acheive this without manually entering all the prefixes as grammar or using an external program?
(Prefix) (Fixed Text) (Variable timestamp)
The format of each of these items is very easy to define as a regex.
I want to mark as unimportant the lines having the same (Prefix) (Fixed Text) yet different timestamps.
Using grammar, I was able to achieve this, but is requires a new grammar for each prefix. I created a grammar for Prefix1, Prefix2, Prefix3... and it works really well. The problem is that I have several different prefixes and I would prefer no to enter them manually.
Creating grarmmar element with a regex for the prefix would result in considering that Prefix1 vs Prefix2 is uninmportant, which is not the case.
If I undestand replacements, correctly, it allows to define rules to replace some defined string/pattern in one file, and after the replacement, match that with the content of the other file. Given that the content of the timestamp changes, there is no way to write a rule that will transform the original line in the final one.
Another option would be to create an external program to replace the timestamp by a series of identical characters.
Is there any way to acheive this without manually entering all the prefixes as grammar or using an external program?
Comment