Parse text from a horizontal file

You can use the file type parsing strategy to parse text in files 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.

Before you begin

Role required: pd_admin

Basic knowledge of programming is desirable.

About this task

You can use this parsing strategy only for text files.
Attention: Do not use this parsing strategy for non-text files such as 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 the parsing operations from the Operation list.
  2. Select one of these options from the Parsing strategy list:
    • Oracle
    • JSON file
    • Properties file
    • XML file
    • LDAP file
    • INI file
  3. If working in the Debug mode, perform the following steps:
    1. Click Retrieve or Retrieve File Content to display the content of what you are parsing in the Output pane.
    2. Select the string in the text box. All matching strings in the same context are automatically selected.
    3. Assign the string to a variable on the Define Variable Name form. Provide a unique and meaningful name and click OK.
    4. To identify additional strings and variables, click the plus icon.
  4. Define the string to be parsed from within Debug mode, or on the Advanced Parsing Options form (outside of Debug mode).

    Displaying the Advanced Parsing Options area
    OptionDescription
    Outside of Debug mode (Advanced Parsing Options form)
    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.
  5. To end the discovery process if no results are found, select the If not found check box.
  6. Click Close Advanced.