You can search for specific text in the catalog and replace it with other text using Catalog Manager.
You can open the catalog in either online or offline mode. In offline mode, you can replace all objects. In online mode, you might be unable to replace certain objects, depending on your permissions.
Specifically, you can search for and replace:
A simple text string using a dialog, as described in Searching for and Replacing a Simple Catalog Text String.
For example, suppose that an object contains the string "My Misspeled Wirds." You can use Catalog Manager to search and replace that string with the proper text of "My Misspelled Words."
Multiple or complex text strings all at the same time using an XML file, as described in Searching for and Replacing Multiple Catalog Text Strings.
For example, suppose that the administrator renames a subject area, a table, or column in the repository file. The table "Sales" might be renamed "MySales." You can use Catalog Manager to search and replace all uses of that object throughout the catalog.
You can search for a simple text string in the catalog and replace it with other text.
To search for and replace a simple text string:
You can perform more powerful search and replace operations on multiple catalog text strings all at the same time by importing a XML file that identifies each text string to search for and replace.
In the search and replace XML file, you use an action element to identify each text string to search for and replace.
The action elements are contained in a commands element. The action element has the following attributes:
command — Specifies the text to replace. The valid value is:
textReplace — Replaces all the text that matches in an XML file, such as a column name.
oldValue — Specifies the text string to search for.
When you specify this attribute for the textReplace command for the search and replace XML file, you must use the full Java regex syntax, which is not like a normal string. To replace a string, you must do the following:
Escape any special Java regex characters (such as brackets, parentheses, dollar signs, and carets).
Escape any special "normal" string characters (such as back slashes and quotes).
Because you are working in an XML file, escape any special HTML characters (such as quotes and ampersands).
The full Java regex syntax is described in the following document:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
The following table provides sample strings for use with the regex syntax in search criteria.
Search String Entered | Result |
---|---|
a |
Adds wildcards before and after your search string (for example, *a*), enabling the search to return results that contain the letter "a". |
^a |
Adds a wildcard after your search string (for example, a* ), enabling the search to return results that begin with the letter "a". |
a$ |
Adds a wildcard before your search string (for example, *a ), enabling the search to return results that end with the character "a". |
a\* |
Searches explicitly for strings containing a character followed by an asterisk (*) for example, "a*". |
? |
Use a question mark (?) with a character and an asterisk (*) to return zero (0) or more occurrences of a character. For example ?a* returns zero or more occurrences of the character "a". |
newValue — Specifies the replacement text.
ignoreCase — Ignores case when set to true, but becomes case-sensitive when set to false. The default value is false.
The following is a partial example of an XML file for searching for and replacing a text string.
<?xml version="1.0" encoding="utf-8"?> <actions> <action command="textReplace" oldValue="boots" newValue="HoleyShoes" ignoreCase="true"/> </actions>