Adding Line Styles
After opening the report file in Extract Editor, scroll through the file and identify a section that is most representative of the entire file. Before defining the line styles, determine if sample size, starting and ending line, and padding options need to be changed. To change these options, see
Display Options in
Configuring Extract Editor Options.
To add a line style:
1. Open the .extract file.
2. On the
Design tab, highlight the line for which you want to define a line style, right-click and select
New Line Style. You can also click
icon on the Extract tool bar. The Add Line Style window is displayed.
The Line Name drop-down list displays the highlighted text as the default line style name. If required, you can change this name. It must be unique within the extract. It can include upper and/or lower case letters (A - Z, a - z), numbers (0 - 9), and underscores ( _ ), but cannot begin with a number and cannot include spaces.
When you are defining line styles, Extract Editor assigns line style names as follows:
• If the selected text is highlighted in the Design tab, Extract Editor uses the alpha characters of the highlighted text as the default line style name. If there are no alpha characters in the section of text that is highlighted, Extract Editor names the line style as Style1, Style2, and so on.
• If an entire line is highlighted, Extract Editor uses best alphanumeric word from the selection.
3. Define the recognition rules to identify the line style: By default, Extract Editor uses the exact highlighted text as the recognition pattern for the line style. From the Recognized By drop-down list, select one of the following options:
• Pattern: Creates line style recognition rules based on a pattern. Patterns can be literal strings or regular expressions (supported by CXL). Extract Editor matches the text found in the file based on the defined pattern and extracts the information. To add additional recognition rules, click the
icon. To delete a recognition rule, click
icon.
Pattern recognition rule includes a combination of the parameters available in the Line Recognition Rules tab. .
Note: Begin and End columns are editable only if the Search In value is Column Range.
• Blank Line: Matches any blank line found in the report file.
• Exact Line Number: Extracts the information from the specified line number.
4. Define the line action for the recognition rule. The action determines how the Extract Editor processes the lines of text or the data within the lines of text that matches the line style. The available options are:
• Collect Field Contents: Collects data for the fields defined in the line style. This is the default action if Pattern is selected as the recognition type.
If you have several lines to gather data from before the first Accept Record line, then these lines must have different line styles with Collect Field Contents action associated with them.
• Reject: Rejects the line. This is the default action if Blank Line or Exact Line Number is selected as the recognition type. When a line style is defined with this action, then line styles that are after this line style (as per the order) are not processed and execution is moved to next line. This option is useful for rejecting any unnecessary lines such as blank lines or lines that are not required in the output.
• Accept Record: Finds the end of the first record or the beginning of the second record, and accepts a single record of data and includes it in the output. This stops the collection process for the first record and begins it for the second record, thus setting a limit on the number of fields in the eventual output for that record. If you want to define more than one type of record in a single report file, then you can do that by defining more than one line style with Accept Record action. You must assign the fields to each record type, based on how you want the data to be exported. The values can be set individually for each Accept record.
When your report does not contain a consistent last line, you have to define the Accept Record as the first line of a header or some other consistent line of text that appears at the beginning of each section of the report. When this line action is chosen, the resulting first record will contain no data. It will be blank. To avoid a blank first record in your output file, select the Skip First Accept option.
5. When fields are defined in the line style, then the Line’s Fields tab displays list the defined fields.
6. Click OK.
The line style name is displayed on the left side on the Design tab. The order of the line style determines which line style is displayed if more than one line style matches the same line.
7. Repeat the process until you have defined line styles for all the lines of text that contain the information you want to assemble into one data record.
Note: Do not define any lines of text from which you are not extracting data.
8. Click
File >
Save or click
to save the extract file.
Line Style Icons
The following table provides the list of line style icons based on the defined line styles and actions.