WalkSiblingDirectories

MacroModule
genre File
author Jonas Singe
package FMEstable/ReleaseMeVis
definition WalkSiblingDirectories.def
keywords directory, walk, folder, sibling, compare

Purpose

Walks through two directories that contain files with the same names.

Usage

  1. Select two directories that you want to compare.
  2. Optionally, specify filename patterns to exclude some of the files.
  3. Press update to load the file comparison list.
  4. Use the navigation controls to walk through the file pair list.

Details

The files can also be located in subfolders of the directories. The paths of the currently selected file pair are outputted and the module user can decide on his own what do with them.

If a file is only contained in one of the folders, it shows up in the file pair list and the path for the opposite folder is an empty string.

Tips

The list of comparison entries can also be accessed on scripting level:

entries = ctx.module("WalkSiblingDirectories").object().getAllComparisonEntries()

for entry in entries:

print entry.relativePath           # e.g. exampleSubfoldertest.txt

print entry.absolutePathReference  # e.g. C:/reference/exampleSubfolderTest.txt

print entry.absolutePathResult     # e.g. C:/result/exampleSubfolderTest.txt

Windows

Default Panel

../../../Projects/WalkSiblingDirectories/Modules/mhelp/Images/Screenshots/WalkSiblingDirectories._default.png

Parameter Fields

Visible Fields

First folder:

name: inFolder1, type: String

First folder that should be compared.

Second folder:

name: inFolder2, type: String

Second folder that should be compared.

Include:

name: inIncludePattern, type: String

If include patterns (separated by spaces) are specified, only entries matching at least one of these patterns are included in the list.

Regular expression (inCanIncludePatternContainRegExp)

name: inCanIncludePatternContainRegExp, type: Bool, default: FALSE

If checked, the include pattern can contain regular expressions.

Exclude:

name: inExcludePattern, type: String

If exclude patterns (separated by spaces) are specified, entries matching at least one of these patterns are excluded in the list.

Regular expression (inCanExcludePatternContainRegExp)

name: inCanExcludePatternContainRegExp, type: Bool, default: FALSE

If checked, the exclude pattern can contain regular expressions.

Current file pair:

name: outCurrentFilePair, type: Integer, persistent: no

The number of the currently selected file pair.

Total number of file pairs:

name: outNumberOfFilePairs, type: Integer, persistent: no

The total number of file pairs in the comparison list.

File in first folder:

name: outFile1, type: String, persistent: no

The absolute path to the currently selected file in the first folder.

File in second folder:

name: outFile2, type: String, persistent: no

The absolute path to the currently selected file in the second folder.

Process Directories

name: processDirectories, type: Trigger

Generates the file comparison list.

First

name: first, type: Trigger

Jump to first file pair in the comparison list.

Last

name: last, type: Trigger

Navigate to the last file pair in the comparison list.

Jump to selected pair:

name: inSelectedFilePair, type: Integer, default: 0

Select a file pair by number that should be jumped to.

Jump

name: jumpToSelectedFilePair, type: Trigger

Jump to the file pair selected in the inSelectedFilePair field.