All Products
Search
Document Center

DataWorks:String replacement

Last Updated:Aug 24, 2026

In DataWorks Data Integration, you can use the string replacement component in single-table real-time synchronization tasks to replace strings in specified fields.

Step 1: Configure a Data Integration task

  1. Create a data source. For more information, see Data source management.

  2. Create a Data Integration task. For more information, see Configure a single-table real-time synchronization task.

    Note

    For single-table real-time Data Integration tasks, you can add a data processing component between the source and destination components. For more information, see Supported data sources and synchronization solutions.

Step 2: Add the string replacement component

  1. In the single-table real-time synchronization task, enable the Data Processing switch, click +Add Node, and select the Replace String component.

  2. Configure rules.

    Click Add rule and configure the following parameters. You can add multiple rules.

    • Field name: Select a text field from the previous node.

    • Content to be replaced: The string to search for. When regular matching is disabled, Java escape characters are supported, such as \t (tab character), \n (line feed), and \u0001 (Unicode character).

    • Replacement content: The replacement string, which supports Java escape characters such as \t (tab character), \n (line feed), and \u0001 (Unicode character) when regular matching is disabled.

    Note
    • Regular matching: Specifies whether to enable regular expression matching. When regular matching is enabled, see Class Pattern for the regular expression rules supported by the original string. You can use $+number in the new string to reference groups from the regular expression. For example, if the field content is no.9526, the original string is set to no.([0-9]+), and the new string is set to $1, the field content becomes 9526 after the replacement.

    • Case Sensitive: Specifies whether the search for the original string is case-sensitive.

Next steps

After you configure the Data Source and String Replacement, you can click Preview Data Output to check if the output data of the current node meets your requirements.