Find and Replace Dialog

Use the Find and Replace dialog to change the names of multiple variables at the same time. This is a helpfulway of substituting different words into names and can be very convenient for copy and paste operations. It will also automatically clean up trailing numbers that are common when pasting.

Open the Find and Replace dialog from the Edit Menu or by using the keyboard shortcuts Shift+Ctrl+F or Ctrl+H on windows or Shift+⌘+F on the Macintosh.

Find what

Enter the string you want to find. There are options below to indicate if you want the search to be case sensitive or only for a whole word.

Replace with

Enter the text to replace the string when found. This can be blank to simply delete the string. The replacement string will be used with the same text as typed, regardless of the case of the word that is found. It can contain leading and trailing spaces.

Note If the replacement process ends up generating a double space, it will automatically be compacted to a single space.

Within

This determines where the search and replace process will take place.

Include sub-modules, if checked, will search for variables contained in selected modules (if Current Selection is checked) or in modules contained in the current module is that is checked. It is has no effect if entire model is checked.

Note When making replacements cross-level variables are ignored. Names will be changed only if the parent is included in the search.

Look in

This determines where to make the name replacement. The default is just the variable name, but you can also replace name in units and documentation. Typically you would select just one of these, but combinations will work.

Variable Name, if selected, will change variable names.

Units, if selected, will change the units of measure.

Documentation, if selected, will change the documentation for variables.

Equation, if selected, will change text within the equations of the variables.

Tags, if selected, will change the tags for variables. This may create new tags that have not used in the model before.

Options

Use options to restrict the name search, and control the replacement.

Case sensitive, if checked, will match a word only if the case exactly matches the way it is entered. The word "energy" for example, would not match "Energy" if this is checked.

Drop training numbers, if checked, will drop trailing numbers after making the substitution. For example replacing "Core" with "Container" would rename "Primary Core 1" to "Primary Container". If, after substitution, there is still a conflict ("Primary Container" is already defined in the model) a number will be added back.

Search type

Search type restricts the conditions under which a match is found.

Contains,matches text appearing anywhere in a name.

Match whole words only will only match a word if it is separated from other words. Thus a variable named "Population" would not match "Pop" if this is checked.

Variable starts with will only match a name that starts with the search string.

Variable ends with will only match a name that ends with the search string.

Replace All will make the replacement and report on the number of variables that were affected.

Undo will undo the last replacement. You can also use undo after closing the dialog just as for any other change. Each invocation of undo will revert one press of the Replace All button that caused a change.

Help will open this help topic.

... changes have been made shows how many variables were affected by the last replace operation.

Close will close this dialog.

Persistence

The selections you have made in the Find and Replace dialog will remain while the model is open. After the model is closed and reopened the dialog will start in its empty default state the next time it is used.