File utilities plug-in task reference
The File Utilities tasks have arguments that you can specify.
Convert encoding
The Convert Encoding task changes the encoding of a text file. The result can be stored in a new file, or the source file can be overwritten.
| Argument | Description |
|---|---|
| Source file | Name of the source file to be re-encoded. |
| Source encoding | The encoding of the source file. The default value is Auto detect. |
| Target file | Name of the target file to store the encoding in. Leave empty to overwrite the source file with the result. |
| Target encoding | The encoding to use. The default value is Unicode. |
Checksum
The Checksum task calculates the checksum of a column in a file with the option of filtering out rows that are based on the content of another column.
| Argument | Description |
|---|---|
| File name | Name of the file to calculate the checksum for. |
| Delimiter | The delimiter that separates columns. The default value is Comma ',' |
| Column | The column number to sum. The first column is
number 1. The default value is 1. |
| Column width | The width of the column to select. Only used
when the delimiter is fixed width. The default value is 0. |
| Filter type | The type of filter to apply. Leave as None to
have no filter. The default value is None |
| Filter column | The column number to filter on. The first column is number 1. |
| Filter column width | The width of the filter column to select. Only
used when the delimiter is fixed width. The default value is 0. |
| Filter expression | A regular expression for the filter to match. |
| Filter expression syntax | The syntax for the filter expression. It is
one of
The default value is Regular expression. |
| Ignore case | If true, filter matching is case-insensitive. The default value is True. |
Copy
The Copy task copies files or directories on the server.
| Argument | Description |
|---|---|
| Source | The name of the files and directories to copy. Use the wildcard characters * and ? to specify multiple files or directories. |
| Destination | The destination file or directory. When you copy multiple files, only a directory is allowed. |
| Overwrite | If checked, overwrite existing files. If cleared,
the task exits without overwriting existing files. The default value is cleared. |
Delete
The Delete task deletes files or directories.
| Argument | Description |
|---|---|
| File name | Name of the files and directories to delete. Use the wildcard characters * and ? to match multiple files or directories. |
| Recursive | If checked, delete directories and their contents
recursively. If cleared, the task fails to delete a non-empty directory. The default value is cleared. |
| Force | Force the deletion of the files. This option
is similar to the "-f" option of the UNIX "rm"
command. The default value is cleared. |
Delete directory
The Delete Directory task deletes empty directories.
| Argument | Description |
|---|---|
| Path | Name of the directories to delete. Use the wildcard characters * and ? to match multiple directories. |
Delete less days
The Delete Less Days task deletes files in directories that have not been modified in the last n days.
| Argument | Description |
|---|---|
| Path | The path to delete. Wildcards are allowed. |
| Days | Files that have not been modified within this number of days are deleted. |
| Recursive | If checked, delete directories and their contents
recursively. If cleared, the task fails to delete a non-empty directory. The default value is cleared. |
| Force | Force the deletion of the files. This option is similar to the "-f" option of the UNIX "rm" command. |
Detect Unicode
- UTF-7
- UTF-8
- UTF-16
- UTF-32
The task succeeds if the file is encoded in Unicode. Otherwise, the task returns the error Not Unicode.
| Argument | Description |
|---|---|
| File name | Name of the file to determine the encoding of. |
Extract List
The Extract List task extracts a list of values from a column-based file and optionally filters the result that is based on values in a filter column. The file can either have variable length columns that are delimited with a single character delimiter, or have fixed-length columns.
By capturing the output from this task in an extract list post task action, it is possible to iterate over this list when you run a subsequent Iterate over list task in Cognos® Command Center.
| Argument | Description |
|---|---|
| File name | The name of the file to extract a list from. |
| Delimiter | The column delimiter. The default value is Tab. |
| Column | The column to sum. The first column is numbered
1. The default value is 1. |
| Column width | The width of the column to select. Only used
when the delimiter is fixed width. The default value is 0. |
| Filter type | Optional filter that specifies what rows to
include or exclude from the sum. The default value is None. |
| Filter column | Optional filter column. First column is numbered
1. The value is ignored if the filter type is None. The default value is 1. |
| Filter column width | The width of the filter column to select. Only
used when the delimiter is fixed width. The default value is 0. |
| Filter expression | Optional filter expression. Rows are included or excluded from the list that is based on a match with this expression. |
| Filter expression syntax | The syntax for the filter expression. It is
one of
The default value is Regular expression. |
| Suppress duplicates | If true, duplicate elements are removed from
the list. The default value is False. |
| Sort mode | Specifies how the extracted list elements are
sorted. The default value is No sorting. |
| Ignore case | If true, filter matching and record sorting are case-insensitive. |
Filter by time
The Filter by Time task scans log files that are based on a time stamp. The task receives a time stamp and information about how to identify time stamps on each log line. It then skips lines from the file until it meets a line with a date that is later or equal to the supplied time stamp. This line and all remaining lines are then copied into a destination file, creating a log snippet that can then be further inspected for error messages.
| Argument | Description |
|---|---|
| Input file | The name of the file to scan. |
| Output file | The name of the output file. |
| Allow overwrite | If true, an existing output file is overwritten. The default value is False. |
| Time | This parameter is the cutoff time and only files
that follow the first line with a date that is later or equal to this
time are included in the output. The time parameter can be given
in one of the following formats:
For more information about these formats, see the description of the Timestamp format argument. Typically, the $(Date) system variable is used. For example, $(Date{MM/dd/yy HH:mm}) The default value is $(Process [last].Start {MM/dd/yy HH:mm}). |
| Prefix expression | An optional regular expression (using the standard Java™ regular expression syntax) for the string preceding the time stamp on each log line. |
| Prefix expression syntax | The syntax for the prefix expression. It is
one of
The default value is Regular expression. |
| Ignore case | If false, ignores the case of characters when
you search for the prefix pattern. The default value is True. |
| Timestamp format | The format of the time stamp on the log lines. The format is specified by
using a date and time pattern string.
The format is a combination of pattern characters and separators like / - : . and space. For example, ddd MMM dd HH:mm:ss yyyy matches Mon Sep 7 04:45:12 2012. |
| Timestamp offset | An optional time zone offset that can be added
to the time stamps before comparison with the supplied time. This
is useful if the time stamps in the file are in a local time without
any time zone information. The default value is 0. |
| Context length | The number of lines that precede the first matching
line that are to be included in the output. For example, assume
that the first matching line is the In this case, setting the
context length to 2 causes the The default value is 0. |
Find
The Find task searches for a text string in a file or in a set of files.
| Argument | Description |
|---|---|
| Files | Specifies the file or set of files to search. |
| Pattern | The text string to find. |
| Pattern syntax | The syntax for the pattern.
The default value is Exact. |
| Case sensitive | If false, ignores the case of characters when
you search for the pattern. The default value is False. |
| Output format | Sets the output format. Brief outputs the number of occurrences. Verbose outputs the matching lines. |
List directory
The List Directory task lists the content of a directory on the server.
| Argument | Description |
|---|---|
| Directory | The directory for which to list the contents. |
| Output format | Format of the task output.
The default value is Full. |
List file content
The List File Content task lists the contents of a file.
| Argument | Description |
|---|---|
| Computing resource | The host computing resource. |
| File name | The file to list the contents of. |
Make directory
The Make Directory task creates a directory on the server.
| Argument | Description |
|---|---|
| Directory | The name of the directory to create. |
Move
The Move task moves files and directories on the server.
| Argument | Description |
|---|---|
| Source | Name of the files or directories to move. Use the wildcard characters * and ? to match multiple files or directories. |
| Destination | The new location of the files or directories. When you move multiple items, the destination must be a directory on the server. |
| Overwrite | If checked, overwrite existing files. When cleared,
the task exits without overwriting existing files. The default value is cleared. |
Move less days
The Move less days task moves files or directories that have not been modified in the last n days.
| Argument | Description |
|---|---|
| Source | Name of the files or directories to move. Use the wildcard characters * and ? to match multiple files or directories. |
| Destination | The new location of the files or directories. When you move multiple items, the destination must be a directory on the server where the agent is installed. |
| Overwrite | If checked, overwrite existing files. When cleared,
the task exits without overwriting existing files. The default value is cleared. |
| Days | Files that have not been modified within this number of days are moved. |
Replace
The Replace task searches for and replaces text in a file.
The result of the search and replace operation is either written to a new destination file, or the task can perform an in-file replacement that overwrites the source file with the result.
You can search for and replace text in multiple files within a single task by using wildcards. In this case, the task supports only in-file replacement, and the destination file argument must be left empty.
| Argument | Description |
|---|---|
| Source | The name of the file to search. Use wildcards to specify multiple files. |
| Destination | The name of the destination file. The task fails
if the file exists. Leave empty to perform an in-file replacement, overwriting the source file. |
| Allow overwrite | If true, an existing destination file is overwritten. The default value is False. |
| Find | The text string to find. |
| Replace | The text string to insert at the matching locations. |
| Find syntax | The syntax for the find pattern.
The default value is Exact. |
| Case sensitive | If false, ignores the case of characters when
you search for the pattern. The default value is False. |
Tar
The Tar task creates a tar archive.
| Argument | Description |
|---|---|
| Output archive | Name of the archive to create. If necessary, a ".tar" extension is added to the name. |
| Source files | Name of files or directories to add to the tar archive. Use semicolons or wildcards to specify multiple files or directories. |
| Overwrite | If true, an existing archive is overwritten
by this task. The default value is False. |
Unzip
The Unzip task extracts a .zip or .gzip archive.
| Argument | Description |
|---|---|
| Archive | The name of the archive to extract. |
| Destination directory | The name of the directory to extract the archive to. The directory is created if it does not exist. |
| Compression | The compression format for the archive.
The default value is Auto detect. |
| Overwrite | If true, existing files are overwritten when
you extract the archive. The default value is False. |
Untar
The Untar task extracts a tar archive.
| Argument | Description |
|---|---|
| Archive | The name of the tar archive to extract. |
| Destination directory | The name of the directory to extract the archive to. The directory is created if it does not exist. |
| Overwrite | If true, existing files are overwritten when
you extract the archive. The default value is False. |
Zip
The Zip task creates an archive. The compression format is derived from the extension of the output archive.
| Argument | Description |
|---|---|
| Output archive | The name of the archive to create. The archive
format is derived from the file extension.
|
| Source files | The name of files or directories to add to the .zip file. Use semicolons or wildcards to specify multiple files or directories. |
| Overwrite | If true, an existing archive is overwritten
by this task. The default value is False. |