FlowHeater

SubString Heater, extracting substrings from a string

PrintE-mail

SubString HeaterThe SubString Heater is used to extract a part of a string. After you drag/drop the Heater into the Designer workspace, you open the configuration popup by a double click on the icon. Alternatively, you can gain access to the properties in the popup using the context menu for the Heater (right click).

In the popup you can specify the part of the incoming string you wish to extract and deliver forward for subsequent processing.


SubString Heater, config dialog
SubString Heater, config dialog

Parameters


Start Offset: With this parameter you define the offset position in the incoming string you wish to start copying characters from. Note: An offset of 0 means the first character in the string and an offset of 5 would commence with the sixth character. If the string is shorter than this, an empty substring is delivered.

Length: maximum number of characters that are to be copied from the Start Offset position of the incoming string and output as a substring. In this case a zero means until the end of the string.


Example

We have a CSV text file with German address data, where the postcode is always of five digits and precedes the name of the town as a single field, divided by a single space. For subsequent processing, this field will be imported into an SQL database table where t he information is stored as two separate fields.

...;Hauptstrasse 123;90471 Nuernberg;Deutschland/Germany;...

In this case we can simply use two SubString Heaters and feed the same input into both (via a Clone Heater, if necessary).


1. SubString Heater for the postcode
Start Offset = 0
Length = 5

2. SubString Heater for the city
Start Offset = 6
Length = 0


Note: Note that in this case the dividing space is assumed, but effectively dropped.


Please also refer to the general information on the use of Heaters (functions)

 

Who's Online

We have 5 guests online

Login