Cisco Active Network Abstraction Customization User Guide, 3.6
Parsing Operators/Rules

Table Of Contents

Parsing Operators/Rules

Header and Footer

Description

Dialog Box

Parameters

Remove Lines

Description

Dialog Box

Parameters

Select Lines

Description

Dialog Box

Parameters

Replace

Description

Dialog Box

Parameters

Match

Description

Dialog Box

Parameters

Set

Description

Dialog Box

Parameters

Substring

Description

Dialog Box

Parameters

Parse Integer

Description

Dialog Box

Parameters


Parsing Operators/Rules


This chapter describes the pre-defined text manipulation operators available for parsing raw device input and turning it into a soft property that are available in the Add/Edit Parsing Rule dialog box. For each operator its name, description, expected input, validation rules and the unique fields displayed in the dialog box are described. An example of each operator is also provided.

For more information about the Add/Edit Parsing Rule dialog box see Defining the Parsing Parameters.

Header and Footer—Describes the Header And Footer operator and provides an example.

Remove Lines—Describes the Remove Lines operator and provides an example.

Select Lines—Describes the Select Lines operator and provides an example.

Replace—Describes the Replace operator and provides an example.

Match—Describes the Match operator and provides an example.

Set—Describes the Set operator and provides an example.

Substring—Describes the Substring operator and provides an example.

Parse Integer—Describes the Parse Integer operator and provides an example.

Header and Footer

Description

Removes a specified number of lines from the header and footer of the input text.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Header And Footer operator is selected. In addition, the dialog box displays an example using the Header And Footer operator.

Figure A-1 Header and Footer Operator

Parameters

Parameter
Description
Validation Rule

Header lines

The number of header lines to be removed.

Integers only. Mandatory.

Footer lines

The number of footer lines to be removed.

Integers only. Mandatory.


Remove Lines

Description

Removes a range of lines from the specified starting row to the specified end row of the input text.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Remove Lines operator is selected. In addition, the dialog box displays an example using the Remove Lines operator.

Figure A-2 Remove Lines Operator

Parameters

Parameter
Description
Validation Rule

From line

Index of first row to begin removal, inclusive.

Integer only. Mandatory.

To line

Index of last row to be removed, inclusive.

Integer only. Equal to or greater than From line. Mandatory.


Select Lines

Description

Extracts a range of lines from the specified starting row to the specified end row of the input text.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Select Lines operator is selected. In addition, the dialog box displays an example using the Select Lines operator.

Figure A-3 Select Lines Operator

Parameters

Parameter
Description
Validation Rule

From line

Index of first row to begin selection, inclusive.

Integer only. Mandatory.

To line

Index of last row to be selected, inclusive.

Integer only. Equal to or greater than From line. Mandatory.


Replace

Description

Finds one or all occurrences of a substring, which matches a specified regular expression, and replaces it with a specified value.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Replace operator is selected. In addition, the dialog box displays an example using the Replace operator.

Figure A-4 Replace Operator

Parameters

Parameter
Description
Validation Rule

Expression

Search for value or regular expression.

Text. Mandatory.

With

Replace string with value or regular expression.

Text. Mandatory.

From Index

Starting index.

Integer. Mandatory.

Note The value entered in this field must be 1 or higher.

Replace All

Checkbox. Select this option to replace all occurrences of the matching substrings, otherwise only the first instance is replaced.

Default is unchecked.


Match

Description

Finds and extracts a substring, which matches a specified regular expression. If no match can be found the output buffer receives an empty string.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Match operator is selected. In addition, the dialog box displays an example using the Match operator.

Figure A-5 Match Operator

Parameters

Parameter
Description
Validation Rule

Expression

Search for value or regular expression.

Text. Mandatory.


Set

Description

Prints the results of the input and output buffers.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Set operator is selected. In addition, the dialog box displays an example using the Set operator.

Figure A-6 Set Operator

Parameters

Parameter
Description
Validation Rule

Expression

Regular expression template to use for formatting. $_$ specifies the main output buffer.

Text. Mandatory.


Substring

Description

Extracts a substring of a specified length from a specified starting point.

Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Substring operator is selected. In addition, the dialog box displays an example using the Substring operator.

Figure A-7 Substring Operator

Parameters

Parameter
Description
Validation Rule

From Index

Begin index to select.

Integer. Mandatory

Note The value entered in this field must be 1 or higher.

Length

How many characters to select.

Integer. Mandatory


Parse Integer

Description

Uses the substring rule, and when a result is received with the substring it is converted into an integer value.


Note If the substring operator contains any characters the parsing integer operator will fail.


Dialog Box

The Add/Edit Parsing Rule dialog box is displayed below when the Parse Integer operator is selected. In addition, the dialog box displays an example using the Parse Integer operator.

Figure A-8 Parse Integer Operator

Parameters

Parameter
Description
Validation Rule

From Index

Starting index to select.

Integer. Mandatory

Note The value entered in this field must be 1 or higher.

To Index

Ending index to select.

Integer. Mandatory