Parse text using delimited text

In discovery patterns, you can parse text using the Delimited text parsing strategy.

Before you begin

Basic knowledge of programming is desirable.

Role required: pd_admin

About this task

You can use this parsing strategy for extracting data from any text file. Define which segment of this text file to extract by entering the symbol or word which serves as a boundary and defining the position.

Procedure

  1. Select Delimited text from the Define Parsing list in one of the following locations:
    • the Identification Sections or Connectivity Sections for Service Mapping
    • the Step window for Discovery
  2. Fill in the fields, as appropriate.
    Field Description
    Include lines with Specify the constraints used to determine which lines are included in the text selection.
    Exclude lines with Specify the constraints used to determine which lines are excluded in the text selection.
    Line separator Specify the non-default character used as a line separator in the text. Default separators are either NEWLINE or CARRIAGE RETURN, depending on the operating system.
    Use default Select this check box to use the default line separator.
  3. To define parse the file and extract the string as a variable from within Debug mode:
    1. Select the string to be parsed in the text box.
      The name box appears.
    2. Provide a unique and meaningful name for the variable. The variable is added to the Variables table. The Line Separator, Delimiters, and Positions attributes for the variable are filled in automatically.

      Define variables for parsing delimited text in the Debug mode.
  4. To define parse the file and extract the string as a variable outside Debug mode:
    1. In the Variables pane, click Add Variable.
      The new variable with the default name _Name_ shows in the list of variables.
    2. Click the new variable and enter a unique and meaningful name.
    3. If necessary, enter a string in the Line Separator field.
      This string is used to identify where lines in the file end. For example, common line separators are "/n" or "/r".
    4. Click the Edit icon next to Delimiters, enter the symbol or word to use as a delimiter and click the Plus icon.

      Adding or editing delimiters
    5. Specify the position. For multiple positions, use commas as separators.
  5. To end the discovery process if no results are found, select the If not found check box.

Example

You can use the Delimited Text parsing strategy for the Parse Variable operation to extract the Queue Manager name of an IBM WebSphere Message Broker.


Example of using delimited text