# The Multi Field Editor

The Multi Field Editor provides a convenient means of doing various text manipulations on one or more fields. The Multi Field Editor always works with the current file selection.

The top of the window displays a list of all the field types supported by Yate. This is where you select which fields you want to edit. Note that not all fields are valid for every function in the editor. When a field which is not valid for a particular function is selected, it is ignored. The count in the banner of the leftmost column, is the number of fields which are selected. You can easily select all, unselect all and invert all items in the list by right clicking in the list and selecting the appropriate menu item. You can also save the current set from the context menu. You can load a saved tag set, created in the application preferences, from the context menu.

Typically you are specifying the fields that you want to process. It is also possible to specify those fields that you do not want to process. You change the mode by clicking on the button at the right of the table's header bar. The table's field column displays the current mode. The all but mode makes it easy to handle the case of custom fields being added in the future. More information can be found in the Field Selection Modes in Tables topic.

The following functions are supported:

Actions

Case

Clear

Copy

Exchange

Find & Remove

Re-Encode

Remove & Insert

Replace

Set

Sort Form

Trim

## Actions

A list of all actions with an M association in the Action Manager is displayed. These are intended to be actions which provide simple text manipulation to the fields currently selected in the Multi Field Editor's list of fields.

The Actions function provides a means of extending the capabilities of the Multi Field Editor by allowing you to run the listed actions. Note that when running an action from the Multi Field Editor, the Action Manager's All Files, Always and Hidden columns are ignored.

You can display a popup window which contains an action's description by means of the Description... context menu item. (Only available if there is a description). An action's description is the first non empty content in a Comment, Force Grouped, Tooltip or Version statement. A search for a description is terminated at the first enabled statement which is not one of the preceding statements or an Empty Line or Constrain Execution to a Single File statement. Hitting the space bar has the same effect as selecting the menu item.

You can also display the online resource documentation (if any) by means of the Resource Documentation... context menu item.

You can open the action for editing via the Edit... context menu item.

You can highlight the action in the Action Manager via the Show in Action Manager... context menu item.

Double clicking on an action item is equivalent to clicking on the Run button.

More information on constructing actions to be run in the Multi Field Editor can be found in Running Actions from the Multi Field Editor.

Back to top of page

## Case

The Case function is used to change the alphabetic case of text in the fields selected in the field list. See Alphabetic Case Transformations for more information.

Back to top of page

## Clear

The Clear function will completely erase the contents of the selected fields. Whenever a field type has more than one item, all of the items will be erased.

Back to top of page

## Copy

The Copy function is used to copy the contents of a selected field or property to the chosen destination fields. You can elect to copy only if the source data is not empty and/or if a destination field is empty.

Back to top of page

## Exchange

The Exchange function swaps the contents of two selected fields. This is the only function which does not use the list of fields at the top of the window.

Back to top of page

## Find & Remove

The Find & Remove function is used to look for an occurrence of a pattern in a field and to remove all text either before or after the matched pattern. The text representing the pattern may optionally be removed.

The Case insensitive checkbox, when selected, specifies that alphabetic case should be ignored when searching.

The Diacritic insensitive checkbox, when selected, specifies that diacritic marks should be ignored when searching.

The from end option specifies that the last occurrence of the pattern should be matched as opposed to the first.

Assuming the supplied pattern is found, the following applies:

- When Remove is enabled, the matched pattern is removed.
- The text before or after the matched pattern is removed
- Leading and trailing whitespace characters are optionally removed.

The following lines describe the effects of the Remove, before and after checkboxes when the pattern is My and the searched field's value is 01-MyAlbum-02.

> Remove, before
>   Album-02
> Remove, after
>   01-
> before
>   MyAlbum-02
> after
>   01-My

Back to top of page

## Re-Encode

The re-encode functionality is described in the Re-Encoding Text topic.

Back to top of page

## Remove & Insert

The Remove & Insert function will remove a counted number of characters at a specified index from the beginning or end of a field. It will optionally then insert a string at a specified index from the beginning or end of the modified field. If you do not wish to remove characters before inserting, set the number of remove characters to 0. If you do not wish to insert anything, leave the then insert field blank. Please note that the indexes start from 0 not 1. When from the end is specified, the last character is at index 0, the next to last character is at index 1, etc. When inserting from the beginning, characters get inserted at the specified index. When inserting from the end, characters get inserted after the specified index. Note that only the insertion text field will process escape sequences.

> If you want to remove the first five characters, specify:
>   Remove 5 characters at index 0 from the beginning
> If you want to remove the two characters before the last character, specify:
>   Remove 2 characters at index 2 from the end
> If you want to insert after the first character
>   Insert text at index 1 from the beginning
> If you want to append text
>   Insert text at index 0 from the end
> If you want to insert text immediately before the last character
>   Insert text at index 1 from the end

Back to top of page

## Replace

The Replace function replaces matched text in the selected fields with new, possibly empty, text.

There are four modes of replacing:

Match String
  In this mode you are looking for occurrences of the from pattern string.
Match Words
  In this mode you match whole words only. For the purposes of this function a match whole word test fails if:
  - the first character in the from pattern is alphanumeric and the character preceding the match is alphanumeric.
  - the last character in the from pattern is alphanumeric and the character following the match is alphanumeric.
Match Characters
  In this mode you are looking for individual characters in the from pattern. If found they are replaced with the replace pattern.
  eg: If the Title field contains a1b2c3
  Replace "0123456789", match characters in the Title field with "#"
  will change the Title to a#b#c#
Match Regex
  In this mode you are attempting to match a regular expression in the replace field. The with field contains the replacement template. Both text fields have appropriate escape sequences on their context menus. The Preview button provides access to the Regular Expression Tester.

You control what and how much text gets replaced by choosing one of:

All
  Replace all occurrences of the matched pattern.
First
  Replace only the first occurrence of the matched pattern.
At Start
  Replace only one occurrence of the matched pattern and only if it is at the very start of a field.
At End
  Replace only one occurrence of the matched pattern and only if it is at the very end of a field.
Last
  Replace only the last occurrence of the matched pattern. Note this option is not supported when matching words.
Leading
  Replace all occurrences of the matched pattern at the very start of a field with one occurrence of the replacement text. Note this option is not supported when matching words.
Trailing
  Replace all occurrences of the matched pattern at the very end of a field with one occurrence of the replacement text. Note this option is not supported when matching words.
Compress
  This option is only valid when matching characters. Any sequence of characters in the from pattern is replaced with a single occurrence of the replacement text.

You can select Case insensitive and make the function case insensitive when matching the Replace text. When matching characters the function is always case sensitive.

You can select Diacritic insensitive and make the function ignore diacritic marks when matching the Replace text. When matching characters or a regular expression the function is always diacritic sensitive.

When replacing via contains, starts with or ends with you can specify Match words. In this mode you match whole words only.

You can specify that you want to match and replace one of a number of supplied strings by specifying the Or matching option and separating the strings with | characters. Replacements will be successively attempted with each string in the supplied list. If one of the strings is matched, the Or matching will terminate immediately after the replacements are applied.

Back to top of page

## Set

The Set function allows you to set fields to specific values. The text field's context menu allows the insertion of a subset of the escape sequence described in Escape Sequences. Using these escape sequences you can set a field to the current or initial value of other fields.

There are three modes:

Set
  The unescaped text pattern completely overwrites the selected fields.
Prepend
  The unescaped text pattern is prepended to the selected fields.
Append
  The unescaped text pattern is appended to the selected fields.

If the Comments field was selected the following pattern world set each file's Comments field to: artist - album - year.

> \[Artist] - \[Album] - \[Year]

Back to top of page

## Sort Form

The Sort Form function is used to set or remove sort formatting or to sort multiple items in one or more fields. There are seven modes to the statement which are described in the Sort Form action statement.

Back to top of page

## Trim

The Trim function is used to remove characters in one or more character sets from specified fields. Note that Remove Invalid is a special mode which performs a context appropriate removal of invalid characters for each of the selected fields. For more information see the Remove Invalid Characters action statement. Note that the Default processing mode is always used.

When Remove Invalid is not selected, the functionality is the same as the Trim action statement. The contents of the custom character set can be configured via the gear button to the right of the custom checkbox.

Back to top of page