Reading an Array Parameter from a File

You can map the values at a selected location in the text file, along with the values in subsequent rows, to the elements of an array parameter.


Before you begin: You must specify the file to read and display its content in the Parse tab of the Text Parser Editor.
See Also
About the General Text Parser
Specifying Word Separator Preferences
  1. Display the content of the file to parse, as described in Specifying the File to Parse.
  2. From the display area on the left side of the Text Parser Editor, select the text to associate with the array parameter.

    To create a one-dimensional array, select a single value from the top of a column of numbers. To create a two-dimensional array, select values from the tops of multiple columns.

    Tips: You can create a marker indicating the relative position of the mapping in the text file, as described in Defining a Marker. You can also click , , and to help you locate the text to select.

    A shortcut toolbar with several options appears.
  3. To map the selected text and following rows to a parameter, do one of the following:
    ActionInstructions
    Map to a new parameter immediately From the shortcut toolbar, select .
    Map to an existing parameter immediately From the parameter list, select an array parameter. From the list of icons at the center of the dialog box, select .
    Map to a new or existing parameter and configure the parse
    1. From the shortcut toolbar or the list of icons in the center of the dialog box, select .

    2. In the dialog box that appears, type a new or existing parameter name.

    3. Select 1D Array or 2D Array from the Map with list, and configure the options described in Configuring a Read Operation.

    Note: You can map to a given parameter from only one set of locations in the file.

    If you choose to map immediately, Optimization Process Composer maps values from as many consecutive rows as possible, as long as each row contains enough values whose type matches the values you originally selected. It creates an array parameter of the appropriate type and dimension (if it does not already exist) and maps values from each row to the elements of the array.
  4. Optional: If desired, you can delete parameters or mappings using any of the following methods:
    • Select a parameter and click from above the parameter list to remove the parameter along with its mapping.
    • Click anywhere within the highlighted text related to the mapping. From the shortcut toolbar that appears, click to remove only the mapping.
    • Select a parameter and click from the icon list in the center of the dialog box to remove only the mapping.
  5. Click OK.