Parse text from .ora, .properties, .xml, or .ini file

You can use the file type parsing strategy to parse text in file of the following formats: .ora file (used by various Oracle products), .properties file (common for Java), .xml file and .ini file. For vertical files, use the vertical file parsing strategy instead.

About this task

You can use this parsing strategy only for text files.
Attention: Do not use this parsing strategy for non-text files like binary files.

You can define multiple extracts and variables. When identifying text for extraction into variables, what you are really doing is identifying the text location within a context.

You can use one of the following methods:
  • In Debug mode, you can select the relevant string from the file contents in the text box. For each string you select, its position and delimiters relative to its context are stored. It enables the same definitions to apply to other files with the same structure even though the text varies. However, it selects the entire text within a context.

    For example, if you try to select only 456 in the text box of an XML file with the following line, the entire string between the keywords is selected.

    <ciTypeID>123-456-7890000000</ciTypeID>
  • On the Advanced Parsing Options form (outside of Debug mode), you can specify a delimiter and position to identify the text string. You can also use this form to make a more refined selection than from within the text box.

    For example, you could specify a delimiter (-) and the number of positions to extract after the delimiter (3) to extract the string (456).

Procedure

  1. Select one of parsing operations from the Operation list in one of the following locations:
    • the Identification Sections or Connectivity Sections for Service Mapping
    • the Step window for Discovery
  2. Select one of these options from the Parsing strategy list:
    • Ini file
    • Oracle file
    • Properties file
    • XML file
  3. Define the string to be parsed from within Debug mode, or on the Advanced Parsing Options form (outside of Debug mode).
    OptionDescription
    In Debug mode
    1. Select the string in the text box. All matching strings in the same context are automatically selected.
    2. Assign the string to a variable on the Define Variable Name form. Provide a unique and meaningful name and click OK.
    3. To identify additional strings and variables, click the plus icon.
    Outside of Debug mode (Advanced Parsing Options form)
    Attention: Ensure you know the exact values for parameters below by checking in the file you want to parse. Entering non-existent values causes the discovery process to fail.
    1. Click Advanced and specify the root path. The root path is the section (hierarchical branch in the file structure) where parsing takes place.
    2. Click the plus icon for each string and variable to be added and fill in the fields, as appropriate.
      • Name: Specify the column name.
      • XPath query: Specify the XPath query for the string. For example, appcmd/APP/@APP.NAME.
      • Delimiter: Specify the delimiter for the string.
      • Position: Specify the position of the string.
  4. To end the discovery process if no results are found, select the If not found check box.
  5. Click Close Advanced.