Skip to main content

Element mass renaming


When copying a data structure from external sources, for example, from an Excel file, etc., the copied fields may need to be adjusted to those already existing in the data schema of the type to rename them or add/remove a prefix, change the case, etc. In such a case, the option that allows mass renaming for fields is helpful.

  1. Select multiple items to change (Ctrl+click), and then press F2 or select the Rename option from the context menu.
  2. After performing the action, the following window will be displayed.

image

The left panel contains the names of the selected elements; the right one displays the names adjusted by a mechanism made of a regular expression (matched to input names) and an output template (where it is possible to refer to an input matching).

  1. Pressing the button Rename results in adding a list of the Rename operations with appropriate old and new names to a Map in place at the moment of performing the renaming operation.

image

An example on the figure shows a common situation of changing the field list prefix. A searched pattern: ^EXCEL\_(.*)$

  1. ^ = the beginning of the string
  2. EXCEL_
  3. (.*) = any string in a group (brackets) to which it will be possible to refer later
  4. $ = the end of the string, not necessary in this particular case as .* in the previous element will match everything to the end

An output template: CLIENT_$1:

  1. CLIENT_
  2. $1 = a content of the first group matched

The effect of the mechanism has been shown in the second column.

See also​

Programming language

Expressions

Syntax prediction