winmerge
winmerge copied to clipboard
Suggestion - ignore first X characters on line when comparing text files
Imagine two files, each containing a line
file1
2023-06-14 message1
file2
2022-04-12 message1
WinMerge will tell me the lines are different, but what I would like to do is ignore the date (first 10 characters) and only compare the rest, so the result would be that the lines match.
Effectively, match text with regex and ignore if matches. I know there are filters in WinMerge now, but when I looked them up the result was that individual lines can't be parsed like that, WinMerge either ignores a line that matches a regex or does not.
If you enter 1-10 in the argument of the IgnoreColumns plugin like below, the date part will be ignored.
Thanks, does it work only for files with a txt extension? Applying it to a .log and it has no effect.
It works even if the extension is .log as follows. Could you show me a screenshot?
You were right, thanks sdottaka. I've tested it again and it indeed works.
What confused me was that when I selected one less character to ignore, the whole line was marked in yellow, instead of only the next starting with the first character that was not ignored.
On the screenshot you posted, if I selected 1-7 it would be less confusing if the first 7 characters, even if different, would be completely ignored and white. Would make it easier to spot differences as well.
Or maybe the ignored part could be highlighted in a different color, or potentially having an option to temporarily hide it. Would be great when working with files where the number of ignored columns is large.