Application icon

Settings - Replacements

Replacements may optionally be used when renaming files or while performing Case or Sort Form functions in the Multi Field Editor or via actions.

Every replacement item consists of a from pattern and a to, possibly empty, pattern. Each item can be a text based replacement item or a regular expression. Each item can be case insensitive or case insensitive.

When a replacement set is applied, its contained items are applied in the listed order. You can drag & drop replacement items to position them in the list.

Certain characters are hard coded for replacement when renaming files. Currently only : and /. These hard coded from patterns are always replaced with the possibly empty pattern specified in the Settings - Rename Invalid character substitution field. If for any reason you want a different to pattern for each of the hard coded values, create standard text replacement items for them.

To create a new text replacement item, click the +T button under the rightmost table.

To create a new regular expression replacement item, click the +R button under the rightmost table. The leftmost column in the table will display an R.

To remove new replacement items, select one or more items in the table and click the - button under the rightmost table.

To modify a replacement item's from field, select a single item in the table and click the button under the rightmost table. Optionally you can click directly on the field.

To modify a replacement item's to field, select a single item in the table and click the ✏︎ button under the rightmost table. This will give you a popup window in which you can edit the value. Optionally you can click directly on the field and do an inline edit.

While you can manually edit the from and to fields for regular expressions, it is far easier to use the Regular Expression Tester to contruct the fields. The tester is displayed when a regular expression item is creatde and when the and ✏︎ buttons are hit.

To make a replacement item case insensitive, enable the checkbox in the CI column for the appropriate item.


In order to make it easier to manipulate a wide variety of files, replacements may be saved in sets. The table on the left of the display displays the defined sets.

To create a new set click on the + button under the leftmost table.

To delete a set, select the sets you want to delete and click on the - button under the leftmost table.

To duplicate a set, select the set you want to duplicate, and click on the button under the leftmost table.

To rename a set, select the set and click on the button under the leftmost table.

Certain replacement sets are used by various functions. These sets are not associated with particular names but are given the special status by means of the context menu. The following status indicators are used:



 Status Description

This is the default replacement set used by both Case and Rename functionality.

C
If you want to differentiate which replacement sets are used by the Case and Rename functionality you can specify two different sets. This set is only used by the Case functionality.

R
If you want to differentiate which replacement sets are used by the Case and Rename functionality you can specify two different sets. This set is only used by the Rename functionality.

F
The Re-encode action statement's Fold Characters mode replaces various Unicode characters with their ISO-8859-1 equivalents. This set can be used to override the default substitutions. You set this special status from the context menu.

If you wish to create a set filled with the default fold substitutions you can do so via the Create a Set With the Default Fold Character Values context menu item. Note that the created set will not automatically be supplied the special Fold Character status. More information on the formatting and usage of this set can be found in Fold Characters Substitutions.

P
This set is called the Sort Form Name Prefix Replacement Set. The set is used by the Sort Form last name - first name functionality. It describes sequences that are inherently part of a last name. For example Di, Le, Van der, etc. The from field is always case insensitive and may contain spaces. The to field is ignored. Note that the from sequences are detected by the presense of a space before a last name. Some of the default entries may seem redundant but may be required. For example O'Grady will always be treated as a single name. However O' Grady will only be treated as a single name if O' is in the set.

S
This set is called the Sort Form Ignore Suffix Replacement Set. The set is used by the following functionality:

  • The Sort Form's (statement and Multi Field Editor), last name - first name function.
  • The List Mnipulate statement's Identify Duplicates function.
  • The Fold statement's Ignore Sort Form Suffix List functionality.

The set describes sequences which follow but are not to be treated as part of a last name. For example, Band, Ensemble, etc. The from field is always case insensitive and may contain spaces. The to field is ignored unless it is equal to +. This is a flag to imply that the sequence can be followed by any other sequence in the set. For example a from field of Jr. with a to field of +, implies that Jr. is to be ignored and may be optionally be followed by another item in the set such as Band.


Note that the case insensitivity checkbox and the regular expression identifier is ignored in the P, S and F status sets when they are used in their intended usage.



Escape Sequences in Text Replacement Items

As of Yate v9.0 all escape sequences in text replacement items are deprecated. While they are still processed, at some point support for them will be removed. Case insensitivity can be specified directly in the item table and all other escape sequences can be handled by regular expressions..

The following information applies to all sets other than the P, S and F status sets.

Replacements are by default case sensitive. Prefixing the from field with: \~ will make it case insensitive.

The from string associated with a replacement is typically a simple text string. However you can specify that a replacement is only to be made if the from string is at the beginning of the source string, follows a newline character or follows a list of supplied characters. Note that when searching backwards for one of the previous conditions, space characters are ignored. The special characters are specified by starting the from string with the sequence \{characters\}. For example a replacement of:

from: \{.-([<{:&'"?!/\}the (ends with a space)
to: The (ends with a space)

will change the word the to The as long as it is at the beginning of a string, after a newline character or after one of .-( [ < { : & ' " ? ! /

If you want to use \~ and \{ sequences, the \~ sequence must come first and be immediately followed by the \{ sequence.

Another special sequence can be used to remove trailing periods (.). A from pattern of \. will remove all trailing periods (.) and replace it with the possibly empty to pattern. Note that trailing periods can be removed in a rename template's advanced settings.



Regular Expression Items

Yate specific escape sequences (named and track variable escape sequences, etc.) are not supported. However, the to field does support Yate Regular Expression Extensions.

The regular expression replaces all matched occurrences. If you only want to change the first or last occurrence, anchor the regular expression by use of the ^ or $ metacharacters.




Rename Templates

Rename Exceptions

Alphabetic Case Transformations