14

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

----------------------------------------------

3 Answers 3

17

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.

1
  • 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. Commented Mar 18, 2015 at 0:09
5

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
0

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

4
  • 2
    Actually, I read that before posting the question. The documentation is rather poor on how to exclude files, there is no clearcut example. Commented Mar 9, 2014 at 2:08
  • Basically, you create a filter for bak and tmp files, and apply that filter to the comparison. Commented Mar 9, 2014 at 2:08
  • Does that mean if I have 1 billion files to compare, it will compare 1 billion files THEN apply filter? Seems not efficient Commented Mar 9, 2014 at 2:12
  • I don't know how it works. Commented Mar 9, 2014 at 2:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .