In DataWorks, you can use the Replace String component to replace strings in specified fields within a real-time single-table synchronization task.
Step 1: Configure a Data Integration task
Create a data source. For more information, see Data source management.
Create a Data Integration task. For more information, see Configure a single-table real-time synchronization task.
NoteFor single-table real-time synchronization tasks in Data Integration, you can add data processing nodes between the Source and Destination nodes. For more information, see Supported data sources and synchronization solutions.
Step 2: Add the Replace String component
In a real-time single-table synchronization task, turn on the Data Processing switch, click +Add Node, and add a String Replacement component.
Configure the transformation rules.
Click Add Rule. You can add multiple rules. Configure the following information:
Field name: Select a text field from the input of the previous component.
Content to be replaced: The source string to find. When regular matching is disabled, you can use Java escape characters, such as
\t(tab character),\n(line feed), and\u0001(Unicode character).Replacement content: The string that replaces the matched content. When regular matching is disabled, you can use Java escape characters, such as
\t(tab character),\n(line feed), and\u0001(Unicode character).
NoteRegular matching: Specifies whether to use regular expressions. If you enable this option, the Original string field supports expressions based on the Java Pattern class. You can use
$followed by a number (for example,$1) in the New string field to reference a captured group. For example, if a field containsno.9526, set Original string tono.([0-9]+)and New string to$1. The field content is then replaced with9526.Case Sensitive: Specifies whether matching for the Original string is case-sensitive.

Next steps
After configuring the Data Source and the Replace String component, click Preview Data Output to preview the output and verify that it meets your requirements.