User Guide : Using Extract Editor : Defining Line Styles : Adding Line Styles
 
Share this page             
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.
Option
Description
And/Or
Logical operator that is applied when more than one recognition rule is defined. The options are And and Or.
Note:  This column is not editable for the first rule.
Search In
Search for the specified pattern in either the entire line or in a specific part of the line. The available options are:
Column Range: Search one or more columns in the line of text for the specified pattern. The range is defined by Begin and End columns.
Whole Line: Search the complete line of text for the specified pattern.
Word1 through Word 9: Search for the specified pattern in the specific word (word 1 through word 9). Words are considered to be separated by space.
Operator
Type of match that must be performed. The available options are:
Contains: Text contains the specified search text or pattern.
Does not contain: Text does not contain the specified search text or pattern.
Equal To: Text exactly equals the specified search text or pattern.
Not Equal To: Text is not equal to the specified search text or pattern.
Pattern Type
Specifies whether the Search text is a String Literal or a Regular Expression. The default type is String Literal.
Search Text/Pattern
Text to search or regular expression. A default value is populated for the first rule based on the selection made in the Design tab.
Begin
Start character index in the line from where to look for the specified search text or pattern.
End
End character index in the line until where to look for the specified search text or pattern.
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.
Relative Position: Identifies the line by relative position by some other line (Base Line).
Relative Position recognition rule includes a combination of the parameters available in the Line Recognition Rules tab.
Option
Description
Line Count
Number of lines relative to the Base Line. Both positive and negative values are allowed.
Operator
Default value is Lines From and the column is Read-only.
Base Line
Text to search or regular expression. A default value is populated for the first rule based on the selection made in the Design tab.
Pattern & Relative Position:
Pattern & Relative Position recognition rule includes a combination of the parameters available in the Line Recognition Rules tab.
Option
Description
And/Or
Logical operator that is applied when more than one recognition rule is defined. The options are And and Or.
Note:  This column is not editable for the first rule.
Rule Type
Select the Rule Type from the drop-down list. Only one relative position rule is allowed. Also, based on the rule type, the other columns are updated.
Search In/Line Count
Search for the specified pattern in either the entire line or in a specific part of the line. The available options are:
Column Range: Search one or more columns in the line of text for the specified pattern. The range is defined by Begin and End columns.
Whole Line: Search the complete line of text for the specified pattern.
Word1 through Word 9: Search for the specified pattern in the specific word (word 1 through word 9). Words are considered to be separated by space.
Operator
Type of match that must be performed. The available options are:
Contains: Text contains the specified search text or pattern.
Does not contain: Text does not contain the specified search text or pattern.
Equal To: Text exactly equals the specified search text or pattern.
Not Equal To: Text is not equal to the specified search text or pattern.
Pattern Type
Specifies whether the Search text is a String Literal or a Regular Expression. The default type is String Literal.
Search/ Base Line
Text to search or regular expression. A default value is populated for the first rule based on the selection made in the Design tab.
Begin
Start character index in the line from where to look for the specified search text or pattern.
End
End character index in the line until where to look for the specified search text or pattern.
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 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. Select one of the following options for Accept record:
Including This Line’s Fields: Include data fields that are defined within this Accept Record line in the data record that is being assembled. Use this option when the Accept Record line is the last line of the record.
Before Collecting This Line’s Fields: Assembles the data record but ending the data field collection on the last defined line of text prior to the Accept Record line. Use this option when the Accept Record line is the first line of a record. This option helps you define records that may have a floating or difficult-to-define end, but has a defined beginning. You can define the beginning line of text as the Accept Record line style and select the Before Collecting option. The Extract Editor will stop collecting data fields at the end of each record correctly.
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.
You can also select the Do Accept At End option to include the last record data for the Accept Record line action.
5. When fields are defined in the line style, then the Line’s Fields tab displays 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.
Line Style Icon
Description
Line action is Collect Fields and line style has no Fields.
Line action is Collect Fields and line style has fields but fields are not assigned to any accept record.
Line action is Collect Fields and Fields are assigned to one or more Accept Records
Line action is Accept Record and line style has no Fields.
Line action is Accept Record and line style has Fields but fields are not assigned to any Accept Record.
Line action is Accept Record and Fields are assigned to one or more Accept Records.
Line action is Reject.