Updated on 2022-12-14 GMT+08:00

String Trim

Overview

The String Trim operator clears spaces contained in existing fields to generate new fields.

Input and Output

  • Input: fields whose spaces are to be cleared
  • Output: new fields

Parameter Description

Table 1 Operator parameter description

Parameter

Description

Type

Mandatory

Default Value

Fields to be trimmed

Information about fields for clearing spaces contained in strings:

  • input field name: Names of input fields. Set this parameter to the names of fields generated in the previous conversion step.
  • output field name: Names of output fields.
  • trim type: Space clearing mode (clearing starting spaces, ending spaces, or starting and ending spaces).

map

Yes

None

Data Processing Rule

  • Clearing spaces at both ends of a value supports clearing spaces at the left end, at the right end, and at both ends.
  • If the input data is null, no conversion is performed.
  • If the number of input field columns is greater than the number of field columns actually included in the original data, all data becomes dirty data.

Example

Use the CSV File Input operator to generate fields A, B, and C.

The following figure shows the source file.

Configure the String Trim operator to generate three new fields D, E, and F.

Six fields are generated, as shown in the following figure.