4.13.41 Filter Text
Function
This plug-in filters text in a specified text file in a Windows or Linux environment.
The following terms are used in this document:
- Filtering
This refers to the processing extracts the text in the specified range of rows and columns from the specified text file. This text file is called the "input file", and the text in the input file is called "input text".
- Column
This refers to the individual strings that make up a row. Columns within a row are separated by a specific character (delimiter).
The following properties can be used as the filtering conditions:
- Extraction-starting row
- Extraction-ending row
- Delimiter
- Extraction-target columns
Examples of filtering text are shown below.
- Input text:
num,family,poolID,capacity,usageRate
1,VSP,0,7225344,0
2,VSP,1,100423680,5
3,VSP,100,4085760,0
4,VSP,11,6150144,11
- Filtering result:
Each column in a row is delimited by the character specified as the delimiter.
Example 1 (when the extraction-starting row is 1, the extraction-ending row is 2, the delimiter is a comma (,), and the extraction-target columns are 1 and 3)
num,poolID
1,0
If the specified extraction-starting row or extraction-ending row does not exist, filtering is performed for existing rows only.
Example 2 (when the extraction-starting row is 5, the extraction-ending row is 6, the delimiter is a comma (,), and the extraction-target columns are 1 and 3)
4,11
If only one extraction-target column is specified, no delimiter is output in the filtering result.
Example 3 (when the extraction-starting row is 1, the extraction-ending row is 2, the delimiter is a comma (,), and the extraction-target column is 3)
poolID
0
If the specified extraction-target columns include non-existent columns, null strings are output for the non-existent columns.
Example 4 (when the extraction-starting row is 1, the extraction-ending row is 2, the delimiter is a comma (,), and the extraction-target columns are 1 and 6)
num,
1,
If no delimiter appears until the row end, the entire row is treated as the first column.
Example 5 (when the extraction-starting row is 1, the extraction-ending row is 2, the delimiter is a hash mark (#), and the extraction-target column is 1)
num,family,poolID,capacity,usageRate
1,VSP,0,7225344,0
The filtering results are output to a file (output file).
This plug-in requires the following server:
- Execution-target server
A server on which this plug-in is executed
Note the following when specifying properties:
(1) Regarding the extraction-starting row (the property common.rowPosBegin) and extraction-ending row (the property common.rowPosEnd)
- Specify an integer from 1 to 2,147,483,647.
- If you do not specify an extraction-starting row, the extraction-starting row is the first row.
- If you do not specify an extraction-ending row, the extraction-ending row is the last row. However, if the input file contains more than 2,147,483,647 rows, the rows after the 2,147,483,647th row will not be extracted.
- Make sure the number specified for the extraction-ending row number is equal to or greater than the number specified for the extraction-starting row.
(2) About the delimiter (the property common.delimiterChar)
- You can specify only one single-byte alphanumeric character or symbol. The default is a single-byte space.
- The single-byte symbols that can be specified vary depending on the OS of the execution-target server.
If the OS is Windows, you can specify a single-byte space or one of the following single-byte symbols: ! # $ % & ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Do not specify a double quotation mark (") or single quotation mark ('). If you specify either of these symbols, this plug-in terminates abnormally.
If the OS is Linux, you can specify a single-byte space or one of the following single-byte symbols: # % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ { | } ~
If you specify any one of the following symbols, this plug-in terminates abnormally: " ' ! $ \ `
(3) Regarding the extraction-target columns (the property common.columnPos)
- Specify an integer from 1 to 2,147,483,647. The value 1 indicates the first column.
- To extract multiple columns, specify column numbers delimited by commas (,). Do not insert space characters between the column numbers.
- If you do not specify an extraction-target column, all columns are subject to extraction.
- The value of this property must begin and end with a number. If you specify a value that does begins or ends with a non-numerical character, this plug-in terminates abnormally. Examples of values that violate this rule are as follows:
[,1,3] [1,3,] [,]
- Do not specify consecutive commas. If you specify consecutive commas, this plug-in terminates abnormally. An example of a value that violates this rule is as follows:
[1,,3]
Use situation
This plug-in can be used to filter text output by other plug-ins.
Prerequisites
For the most recent information about the prerequisite products for the system, prerequisite products for the execution-target server, and the supported OSs for the execution-target server, see the Release Notes.
Prerequisite products for the system:
JP1/Automatic Operation 11-00 or later
Prerequisite products for the execution-target server:
None.
Supported OSs for the execution-target server:
(1) Windows Server 2008 R2 Standard/Enterprise/Datacenter
(2) Windows Server 2012 Standard/Datacenter, Windows Server 2012 R2 Standard/Datacenter
(3) Windows Server 2016 Standard/Datacenter
(4) Windows Server 2019 Standard/Datacenter
(5) Red Hat Enterprise Linux Server 6 (32-bit x86), Red Hat Enterprise Linux Server 6 (64-bit x86_64)
(6) Red Hat Enterprise Linux Server 7 (64-bit x86_64)
(7) Red Hat Enterprise Linux Server 8 (64-bit x86_64)
(8) CentOS 6 (64-bit x86_64)
(9) CentOS 7 (64-bit x86_64)
(10) CentOS 8 (64-bit x86_64)
(11) Oracle Linux 8 (64-bit x86_64)
Conditions for using the execution-target server:
None.
Cautions
(1) When specifying property values, do not specify any string that includes a single quotation mark (') or double quotation mark ("). If you specify such a string, this plug-in terminates abnormally.
(2) To execute this plug-in in a Linux environment, when specifying property values, do not specify any value that includes any of the characters below. If you specify such a value, this plug-in terminates abnormally.
! $ \ `
(3) Do not specify the same path for the input file path (the property common.inputFilePath) and the output file path (the property common.outputFilePath). If you specify the same path, this plug-in terminates abnormally.
(4) To execute multiple instances of this plug-in concurrently, do not specify the same output file.
(5) If "false" is specified for the property common.flagOverwriteOutputFile (which specifies whether the output file can be overwritten) and the output file already exists, this plug-in terminates abnormally.
(6) If you specify a single-byte space for the delimiter (the property common.delimiterChar), the following notes apply:
- If the strings for which filtering is to be performed are separated by two or more consecutive single-byte spaces, this plug-in treats those strings as if they are separated by one single-byte space.
- If the strings for which filtering is to be performed are preceded or followed by single-byte spaces, this plug-in ignores those spaces, regardless of the number of spaces.
- If the OS of the execution-target server is Linux, tab characters in the text for which filtering is to be performed are treated as single-byte spaces.
(7) If the input file contains no input text, this plug-in terminates normally.
(8) If the last row of the input file contains only EOF (End Of File), the handling of that row varies depending on the OS of the execution-target server.
- If the OS is Windows, the last row is not treated as input text.
- If the OS is Linux, the last row is treated as input text.
(9) If a locale environment variable higher than LANG (such as LC_ALL or LC_MESSAGES) is set, the higher locale environment variable takes precedence. Therefore, when executing a plug-in, clear higher locale environment variables, or change their value to that of the LANG environment variable.
Version
02.00.00
Plug-in tags
Control OS,Windows,Linux
Plug-in name displayed in the task log
osFilterString
Return code
0: Normal
12: Error (Mistake by user): Invalid property
23: Error (Invalid environment): The environment requirements are not met.
27: Error (Check the task log for details of the error): Unidentified error
41: Error (An error has been detected in the component): Property not entered (An error has been detected in the component script)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
common.inputFilePath |
Input file path |
Specify the full path of the target file in which the filtering-target text was stored. |
-- |
Input |
R |
common.rowPosBegin |
Starting Line to Extract |
Specify a number indicating the line in the input text from which the filtering target starts. If you omit this setting, the filtering target starts from the first line. |
-- |
Input |
O |
common.rowPosEnd |
Ending Line to Extract |
Specify a number indicating the line in the input text at which the filtering target ends. If you omit this setting, the filtering target ends at the last line. |
-- |
Input |
O |
common.delimiterChar |
Separator Character |
Specify a single-byte alphanumeric character or symbol for the column separator used in the input text. The default setting is a single-byte space character. |
-- |
Input |
O |
common.columnPos |
Columns to Extract |
Specify column numbers indicating the columns to be extracted from the input text. To specify multiple column numbers, use commas (,) as separators. If you omit this setting, all columns are extracted. |
-- |
Input |
O |
common.outputFilePath |
Output file path |
Specify the full path of the target file to which the result of filtering is to be output. If the target file does not exist, it will be created. |
-- |
Input |
R |
common.flagOverwriteOutputFile |
Whether to Overwrite Output File |
Specify whether to overwrite the output file if it already exists. To overwrite the existing file, specify "true". If you do not want to overwrite the existing file, specify "false". |
false |
Input |
R |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |