String Processors

Processors

String Processors are installed with the Dataristix Application and include the following processors.

  • Left String

    Selects a configurable number of characters in the beginning of an input string.

  • Right String

    Selects a configurable number of characters at the end of an input string.

  • Replace String

    Replaces all occurrances of a string in the input string with another string.

  • Substring

    Selects a configurable number of characters within an input string.

  • String Concatenation

    Concatenates two string.

  • String Comparison

    Compares two strings A and B. The result is an integer indicating the order of strings:

    -1: String A comes before String B

    0: Strings are equal

    1: String A comes after String B

  • Lowercase String

    Converts a string to lower case.

  • Uppercase String

    Converts a string to upper case.

  • Split String

    Splits an input string into an array of strings separated by the configured separator string. If the configured separator string is empty, then the result is a string array with a single element containing the original string. For non-empty separators, the result is a string array that contains all substrings that were separated by the separator. You can optionally trim the resulting strings. Use the Array Slice Processor to pick individual elements from the resulting array.

  • Trim Strings

    Removes whitespace from a string either at the start or the end or both.

The processors attempt to convert input values to string-type values before performing their operation.

Add to Task

Add a string processor to a task by dragging it from the “Build” panel onto the task’s “Task Builder” panel.

../_images/tasks-add-string-processor.png

Configuration

Select the processor item in the “Task Builder” panel to view its properties.

For all string processors, you can change the following properties:

  • Name
    The title of the string processor as it appears within the task builder.

The following parameters are configurable for the specific processors.

  • For the “Left String Processor” you can also configure:

    The number of left most characters to select.

    If the specified number of left most character exceeds the number of characters in the input string then the entire input string is selected without error.

  • For the “Right String Processor” you can also configure:

    The number of right most characters to select.

    If the specified number of right most character exceeds the number of characters in the input string then the entire input string is selected without error.

  • For the “Replace String Processor” you can also configure:

    The string that is to be replaced (“Old String”) and the string to replace it with (“New String”). You can optionally ignore letter casing.

  • For the “Substring Processor” you can also configure:

    The index of the first character to select and the number of characters to select.

    If the specified number of characters exceeds the number of characters after the first index then the entire input string is selected without error.

  • For the “Split String Processor” you can also configure:

    The separator string used to split strings and whether to trim the resulting strings.

  • For the “Trim String Processor” you can also configure:

    Whether to trim strings at the start, at the end, or both.

Press the “Apply” button to commit your changes.

Examples

Example 1

The following example shows a task utilizing various string processors.

../_images/tasks-string-processor-example.png

Example 2

The following task uses the “Split String Processor” to extract GPS coordinates and UTC timestamp from an NMEA “GPRMC” sentence.

../_images/tasks-string-processor-example-2.png