The Field-to-Row Splitting operator is added, which can split field values according to specific rules (separators) and generate a new column to store the split values in different rows, as shown in the following figure.
Only fields with text-type data can be split.
You can download the example table data: Teacher_Table.xlsx.
Each teacher in the data table corresponds to multiple students separated by comma (,). You want to split the values of the student field to display one student name per record, as shown in the following figure.
1. Create a scheduled task, drag a Data Transformation node onto the page, and enter the Data Transformation editing page.
2. Drag a DB Table Input operator onto the Data Transformation page and configure the operator to read the data to be processed, as shown in the following figure.
1. Drag a Field-to-Row Splitting operator onto the Data Transformation page and configure the operator to split the values of the student field, as shown in the following figure.
The following table describes the setting items.
Field to Be Split
You can select a field with text-type data from the upstream output for splitting.
Separator
1. Available separators include Semicolon, Comma, Colon, Space, and Custom.
If you select Custom as Separator, you can input any character or string. The whole input content will be used as the separator to split field values.
2. The logic of splitting fields by separator is described below.
The separator is matched from left to right when splitting field values.
The separator is used as the boundary to split fields. If no character is on either side of the separator, the new rows will be filled with null values.
A
Empty
AAA
AA
Split Result
1. Only one field named Original field name_Row Splitting Result is added.
2. The data type of the newly generated column defaults to text.
2. Click Data Preview, as shown in the following figure.
On the Data Preview page, you can preview the first 1000 rows by default, with 20 rows per page.
Drag a Field Setting operator onto the Data Transformation page. Rename the student_Row Splitting Result field, as shown in the following figure.
1. Add a DB Table Output operator and configure it to output the data after processing, as shown in the following figure.
2. Click Save in the upper right corner.
1. Click Run to execute the task. The running result in Log upon successful execution is shown in the following figure.
2. The table data in the database is shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy