Definition and Usage
The Replace text command is used to find and replace or substitute text in a file or data source. It is a very useful RPA command for finding and uniformly replacing text in data files and sources. Common use cases include:
Data cleansing and standardization
Text transformations
Pattern analysis and replacement
Masking confidential text
Parameter Values
Set Parameters
Parameter | Description |
Original text | Enter the text to split or select a text variable |
Operation | Specify how you'd like to replace the text
|
Text to replace | Enter the text to be replaced |
Replace the first matched text only | If ticked, the command will only find and replace the first matched text. |
Ignore case | Specify if you'd like to replace text using case-sensitive or case-insensitive matching |
Replace with | Enter the text to be replaced with |
Save text as | Save the replaced text as a new variable |
Error Handling
Parameter | Definition |
When error occurs | Select the action to be performed when an error occurs
|
Example
Let's say we have a data file containing customer names and addresses from an old legacy system. The address fields have inconsistent notation for the apartment numbers. Some use "#" and some use "Apt". We need to standardize this to "Apt" as part of data cleansing before migrating it to a new system.
This above workflow command setup will find all occurrences of "#215" with "Apt 215" standardizing the apartment number format.