About Markers

The general-purpose parsers (the general and fast parsers) use markers to indicate from where in the runtime text file data should be accessed.

See Also
Creating a General Text Parse
Creating a Fast Parse
About the Text Parser Adapter

If you are reading data from a static file that is not changing, you can simply map to a parameter from selected text without creating a marker. When the parser executes, it searches for the row and column defined by the mapping and reads data from that location in the file.

In other cases, the content of the text file varies, and you cannot predict that a value will be located at a specified row and column; for example, this happens when you explore the design space with the design of experiments adapter, and a new text file is generated for each sample point. Markers take advantage of predictable introductory text (such as column headings) that precede the data you wish to access. You place a marker in this introductory text, and the position of any mappings that follow the marker is considered to be relative to the marker; for example, in the second column of the row following the marker. In effect, markers serve as anchors for your mappings and allow you to read from or write to a region of the text file.

You can do the following to create markers:

  • Select text from the display area in the Parse tab in the general parser and map the text to a marker. Optimization Process Composer uses color highlighting to indicate text that you selected as a marker.
  • Edit the design template file in the fast parser.

You create a marker in your text file by selecting text that you know will appear in the file, such as column headings. Next, you make a second selection indicating text to read from the data file, such as a column of values that appears on the line following the column headings. The parser ignores any text located before the marker in the file.

For example, consider the ASCII data (.dat) file generated by an Abaqus analysis when nodal displacement is requested. The data file contains the following text:

THE FOLLOWING TABLE IS PRINTED FOR ALL NODES
  
       NODE FOOT-  U1             U2             U3           
            NOTE
  
         3      2.1928187E-04 -8.1609040E+03 -3.0602363E+03 
         4      2.1968475E-04 -8.1609036E+03  3.0602362E+03 
         5      1.3024316E-04 -3.2235160E+04 -5.9675101E+03 

You can select the text NODE FOOT- U1 U2 U3 for your marker, and any mappings you create below this marker will be relative to it. For example, you could map the data in the first column to an array parameter containing the node number, and then map the data in the fourth column to another array parameter containing the displacement along the Z-axis. As you select text to map, Optimization Process Composer reflects information about the marker and mapping location in the Current selection area below the display area of the text parser editor. After you confirm the mapping, the positioning information appears in the Actions area. If you have multiple markers, you can choose to which one your mapping will be relative using the Current marker list.

When the parser executes, it searches through the runtime text file for the marker text you defined. When the parser encounters the marker text, it reads data into the parameters from a position in the file relative to the marker. The relative position is defined by the position of the mappings following the marker in the design template file. In the above example, the parser searches the Abaqus data file for the marker text (NODE FOOT- U1 U2 U3) and then skips two lines before reading data from the first column and the fourth column.

By default, Optimization Process Composer creates a marker at the beginning of the file. Therefore, before you create any markers, any mapping you define is always relative to the beginning of the file.