13

How do I include all files and exclude *.bak and *.tmp files in WinMerge compare dialog window?

=========== WinMerge Dialog Window ===========

Left: [Folder-A]               [ OK ]
Right: [Folder-B]              [ Cancel ]
Filter: *.*                    [ Help ]

[x] Include Subfolders

----------------------------------------------
Level1Coder
  • 2,307
  • 6
  • 22
  • 25

3 Answers3

15

Using an inclusive filter, all files are included except those matching a filter rule. For .tmp and .bak files that would be:

def: include ## Inclusive (loose) filter lets through all items not matching rules
f: \.tmp$ ## temporary files
f: \.bak$ ## back up files

When selecting a file or folder, hit select right next to the filter textfield to select a filter. Then hit new, select a filename and adjust the filter by the above lines. After saving, you may have to refresh the filter page by closing and opening it again. Select your new filter and voila.

Zaheylu
  • 677
  • 4
  • 12
  • Tks, it works. Been a while and I have used another software. Now that I know how filters work, I may give WinMerge another chance. – Level1Coder Mar 18 '15 at 00:09
3

You exclude *.bak and *.tmp files as of WinMerge 2.16.19

In 2.16.19 and later, if you put an exclamation mark(!) in front of a mask, files matching that mask will be excluded. Also, a backslash(\) after the mask will cause the mask to match folders instead of files.

Example 2. Excluding folders (In 2.16.19 or later)

In this command-line example, the folder compare operation excludes .git and .vs folders:

WinMergeU c:\project\docs c:\temp /f !.git\;!.vs\

Use this filter:

*.*;f:!*.bak;f:!*.tmp

After adding it, you'll be able to exclude *.bak and *.tmp files.

PS L:\temp\winmerge> Get-ChildItem .\folder1\


    Directory: L:\temp\winmerge\folder1


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         4/30/2023   8:19 PM              0 file1.txt
-a----         4/30/2023   8:19 PM              0 file2.bak
-a----         4/30/2023   8:19 PM              0 file3.tmp


PS L:\temp\winmerge> Get-ChildItem .\folder2\


    Directory: L:\temp\winmerge\folder2


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         4/30/2023   8:19 PM              0 file1.txt
-a----         4/30/2023   8:19 PM              0 file2.bak
-a----         4/30/2023   8:19 PM              0 file3.tmp

*.bak and *.tmp files will be skipped. Example Winmerge output here

file1.txt       Text files are identical      4/30/2023 8:19:05 PM    4/30/2023 8:19:05 PM  txt
file2.bak       File skipped      4/30/2023 8:19:05 PM    4/30/2023 8:19:05 PM  bak
file3.tmp       File skipped      4/30/2023 8:19:05 PM    4/30/2023 8:19:05 PM  tmp
-1

You can use a filter. See here, section 4.1.3. Creating a file filter.