Folder Patterns

Several features in IMatch use folder patterns to specify relative folder names or dynamically create folders at runtime. This topic explains how folder patterns work and how you can use them.

Folder patterns allow you to specify folders by using parts of another folder name. File Relations use folder patterns to specify folders to look for versions in. The Renamer uses folder patterns to Move and Copy files around and you can also use them in the Batch Processor to specify output file names.

How Folder Patterns Work

Consider this folder hierarchy:

Folder pattern allow us to specify each of these folders absolutely or relative to other folders in this hierarchy.

TokenMeaning
{p n}Path Segment Token

n specifies the index of the path segment to use, starting from the end of the path.
All returned names are without a trailing backslash.

{p0} is the fully qualified path of the folder under inspection. {p1} is the parent folder of this folder and so on.

c:\data\images\travels\summer

p0: c:\data\images\travels\summer
p1: c:\data\images\travels
p2: c:\data\images
p3: c:\data\
p4: c: 

{d n}
Folder Name Token

n specifies the index of the folder from the master path. With {dn} you can pick out individual elements out of a path name.
All returned names are without a trailing backslash.

c:\data\images\travels\summer

d0: summer
d1: travels
d2: images
d3: data
d4: c: 

File Name Tokens

{f}File Name Token
Returns the file name with extension: image.jpg
{n}Name Token
Returns the file name without extension: image
{nd}Digits Token
Returns the numerical part of the file name: _DSC12345.RAW => 12345
{e}Extension Token
Returns the file extension: .jpg

Using Folder Patterns

Using the {p} and {d} tokens in IMatch features which support folder patterns allows you to reference other folders by combining a folder name with {p} and {d} patterns.

Consider you work with a file in the yellow Beach folder:

c:\data\images\archive\beach\image.jpg

The fully qualified path of the file is {p0}

c:\data\images\archive\beach

To get the name of the parent folder, you would use {p1}

c:\data\images\archive

To reference the People folder, you could use {p1}\People

c:\data\images\archive\people

This will work whenever the parent folder of the folder under inspection has a People sub-folder.

If you have a backup drive on your network and you want to copy the file to this drive with the name \\NAS\Backup\

and keep the folder name and hierarchy, you could specify \\NAS\Backup\{d1}\{d0} which would result in

\\NAS\Backup\Archive\Beach

The exact way to use folder patterns and what can be achieved with them depends on the feature for which you use them. See the documentation of the corresponding feature for more information.