Skip to Content
SettingsFolder ComparisonsAlignment Overrides

Folder Comparisons > Alignment Overrides

Alignment overrides are created on the Filters page: Settings > New Comparisons > Folder Comparisons > Filters. The tab of an active folder comparison has the same page, for that comparison alone. Alignment overrides are available in DeltaWalker Classic Pro and Oro.

Introduction

Alignment override filters determine how the files and folders on two sides of a folder comparison are matched, or aligned. By default, DeltaWalker Classic aligns files and folders by their names: to be compared, two items need to have the same name. For example, a file named data.txt in the first (left) panel can only be compared to a file named data.txt.

Often, however, you need to align and compare items with different names, for example data.txt with data.log. That is what alignment overrides are for.

Usage

To create an alignment override filter, go to the Filters page, click New and choose Alignment Override:

The New menu of the Filters page, with Alignment Override

In the Add New Filter dialog, type the expressions that match the names in First resource expression and Second resource expression. For example, *.log as the first and *.txt as the second expression tells DeltaWalker Classic to ignore the extensions when it matches files with the extensions .log and .txt. The following before and after screenshots show the result.

Before, with no alignment override filter:

A folder comparison without the alignment override filter

After, with the alignment override filter described above:

A folder comparison with the alignment override filter

Use the Apply to folders field to name one or more folders to apply the alignment override to, separated by the separator the label shows. With large folder hierarchies, naming the folders can greatly speed up the folder comparison.

Expressions

As with the include and exclude filters, you can use shell expressions or the more powerful, and more complex, regular expressions (check Regular expression).

A shell expression can use the following special characters:

? matches any single character once. For example, test??.log matches any name that starts with “test”, continues with two more characters and ends with “.log”, such as test12.log or testAZ.log, but not testA.log.

* matches any characters zero or more times. For example, test*.log matches any name that starts with “test”, continues with any characters and ends with “.log”, such as test1.log, testMyFile.log and even test.log, but not test.logs.

Regular expressions make alignment override filters more powerful. An alignment override filter matches two strings, the names of two files or folders, with two regular expressions. To do so, it uses what is called a dual pattern: a pattern that matches two strings with two regular expressions, the primary and the secondary.

The first expression is the primary because the second refers to it; the second is the secondary because it refers to the first. The secondary expression can refer to the groups of the primary expression.

For example, if test(\d).txt is the primary and test($1).log the secondary expression, ($1) in the secondary expression refers to the first group of the primary. This aligns test1.txt with test1.log, test2.txt with test2.log, and so on.

Examples

LeftRightRegexEffect
sample.txtsample.logNoAligns “sample.txt” with “sample.log”.
*.txt*.logNoAligns files with the extension “txt” with files with the extension “log”, for example “file1.txt” -> “file1.log” and “readme.txt” -> “readme.log”.
start*.htmindex*.htmlNoAligns files with the prefix “start” and the extension “htm” with files with the prefix “index” and the extension “html”, for example “start_page1.htm” -> “index_page1.html” and “start_help.htm” -> “index_help.html”.
Log_(\d+)\.log($1)\.txtYesAligns file names that begin with “Log_”, continue with at least one digit and end with the extension “log” with file names that have no “Log_” prefix, the same digits, and the extension “txt”. For example, “Log_20120616.log” -> “20120616.txt” and “Log_20120617.log” -> “20120617.txt”.

See Also

Last updated on