Field Splitter
The Field Splitter splits string data based on a regular expression and passes the separated data to new fields. Use the Field Splitter to split complex string values into logical components.
For example, if a field contains an error code and error message separated by a comma, you can use the comma to separate the code and message into different fields.
When you configure the Field Splitter, you specify the field to split, the regular expression to use as a separator, and the fields to use for split data. You configure what to do when a record does not have the expected number of splits, and what to do when a record has additional data with more possible splits.
You can keep the original field being split or discard it.
Not Enough Splits
A field has not enough splits when the data does not include as many splits as the number of split fields listed in the processor.
When a field has not enough splits, the Field Splitter can continue or process the record based on the configured stage error handling. When continuing, the processor passes the record with the data split as much as possible, passing nulls for unused split fields.
For example, say the data in a field has only one split separator. This produces data to be written to two split fields, but the processor has three listed split fields. In this case, the processor handles the record based on the Not Enough Splits property.
Too Many Splits
When a field has too many splits, the Field Splitter can include all remaining data in the last listed split field, or it can write the additional splits to a specified list field.
Example
The following Field Splitter uses a comma to split data into two fields: ErrorCode and ErrorMsg. The Not Enough Splits property sends records that do not have enough splits to the stage for error handling, and the stage is configured to discard error records. The Too Many Splits property writes additional data to a MoreInfo list field.
Datetime | Error |
---|---|
21-09-2016 15:33:02 |
GM-302,information that you might need |
21-09-2016 15:35:53 |
ME-3042,message about error,additional information from server,
network error, driver error |
21-09-2016 15:55:48 |
IMD-03234 |
When Field Splitter encounters a comma in the errors field, it passes the data before the comma to the ErrorCode field and the data after the comma to the ErrorMsg field and writes any additional fields to the MoreInfo list field.
The Field Splitter produces the following records. The processor discards IMD-03234 because the record does not include enough data to be split, and the processor is configured to discard those records.
Datetime | ErrorCode | ErrorMsg | MoreInfo |
---|---|---|---|
21-09-2016 15:33:02 |
GM-302 |
information that you might need |
|
21-09-2016 15:35:53 |
ME-3042 |
message about error |
- additional information from server
|