Rename Elements

Using Rename Elements, you can add or remove characters from element names. You can also replace parts of names, optionally using regular expressions to define the sections to replace.

Replacing spaces or other special characters in element names can be particularly useful before exporting to systems where filenames with those characters are problematic to work with.

Other methods of changing or controlling element names exist: Individual elements can be renamed directly in the Navigation Area by doing a slow double-click on the name, or selecting the element and choosing the menu item Edit | Rename. In workflows, the naming of outputs can be configured, as described in Configuring input and output elements.

To launch the Rename Elements tool, go to:

        Toolbox | Utility Tools (Image utilities_closed_16_n_p) | Renaming (Image renaming_folder_closed_16_n_p) |Rename Elements (Image rename_16_n_p)

In the first wizard step, select the elements to rename (figure 37.39).

Image rename_elements_input
Figure 37.39: Select the elements or folders to be renamed.

Alternatively, you can right-click and select "Add folder contents" or, select "Add folder contents (recursively)" to rename all elements in a folder structure recursively. (figure 37.40).

Image rename_elements_recursive
Figure 37.40: Right-click for options to add the contents of folders as inputs. Here, the "Add folder contents (recursively)" option was selected. If "Add folder contents" had been selected, only the elements seqlist1 and seqlist2 would have been added to the Selected elements list on the right.

When multiple elements are supplied as input, each will be renamed. There is no need to check the Batch checkbox for this. However, if you wish to rename only certain elements from the full selection, then checking the Batch box provides the opportunity to do that. When checked, the next wizard step shows the batch overview, where elements can be explicitly included or excluded from those to be renamed, based on text patterns. This step is described in more detail at Batch overview).

Checking the Batch checkbox for this tool also has the following effect when a folder is selected as input:

Important notes about renaming elements

Renaming options

This wizard step presents various options for the renaming action (figure 37.41). The Rename Elements is used for illustration in this section, but the options are the same for the Rename Sequences in Lists tool.

Image renaming_options1
Figure 37.41: Text can be added, removed or replaced in the existing names.

Examples using regular expressions to replace parts of element names

The following are examples to illustrate using regular expressions for renaming. The same principles apply for renaming using the Rename Elements and Rename Sequences in Lists tools.