Help Desk

Submit a ticket My Tickets
Welcome
Login

File Utilities Command Reference

A collection of commands to work with the file system that a Runner is installed on.

Connections

File Utils

File utilities

Inputs

None

Commands

Clean Line Breaks

Removes extra line breaks from cells in a tabular file

Inputs

Input Type Detail Notes
Source File FileField Tabular file with broken lines When extracting data from some systems, the individual cells or rows may have line-breaks from data that users have inputted. When this is the case, we will need to remove them before uploading to a source system that accepts a tabular format.
Delimiter DropdownField Delimiter of the tabular file

Outputs

Output Output Type Notes
Cleaned file File

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error General failure

Copy

Copies files / directories

Inputs

Input Type Detail Notes
Source FileField Name of the files/directories to move. Use the wildcard characters * and ? to match multiple files/directories.
Destination TextField Specifies the new location of the file/directory.
Overwrite BooleanField If checked overwrite existing files. When unchecked the task will exit without overwriting existing files.

Outputs

None

Exit Codes

Code Type Detail
0 Success The task completed successfully
1 Error One or more arguments are invalid
14 Error Source file not found
15 Error Failed to write destination file
16 Error Could not write destination file because a file already exists with the given name.

Create File

Creates a new file

Inputs

Input Type Detail Notes
Text TextField Text to be added to the file
File path TextField Path where the file will be created (optional). If using the file as an output, you will not need to provide a file path
Overwrite BooleanField If selected, will overwrite a file that exists at the specified file path

Outputs

Output Output Type Notes
Created file File

Exit Codes

Code Type Detail
0 Success Indicates that the command completed successfully
1 Error Invalid arguments
15 Error Invalid destination
16 Error Could not overwrite

Delete

Deletes files/directories.

Inputs

Input Type Detail Notes
File name TextField Name of the files/directories to delete. Use the wildcard characters * and ? to match multiple files/directories.

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments are invalid
14 Error Found no files to delete
17 Error Failed to delete specified file(s)

Delete Directory

Deletes one or more directories

Inputs

Input Type Detail Notes
Path TextField Name of the directories to delete. Use the wildcard characters * and ? to match multiple directories.
Recursive BooleanField Recursively delete files/folders inside this directory

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that task completed successfully
17 Error Failed to delete the directory

Find

Searches for a text string in a file or set of files.

Inputs

Input Type Detail Notes
Files FileField Specifies the file or set of files to search.
Pattern TextField The text string to find.
Pattern syntax DropdownField The syntax for the pattern. Exact finds exact matches. Regex denotes standard regular expression syntax.
Case sensitive BooleanField If false ignores the case of characters when searching for the pattern.
Inverse BooleanField Whether or not to find all lines that do not match the specified search

Outputs

Output Output Type Notes
Find results File
Results line count Integer

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments are invalid
2 Error The task failed
14 Error File not found
18 Warning Pattern not found

Find and Replace

Performs find and replace in a file

Inputs

Input Type Detail Notes
Source FileField The name of the file to search
Destination TextField The name of the destination file. The task fails if the file already exists.
Overwrite BooleanField If true an existing destination file will be overwritten
Find TextField The text string to find
Replace TextField The text string to insert at the matching locations.
Find syntax DropdownField The syntax for the find pattern. Exact finds exact matches.Regex denotes standard regular expression syntax.
Case sensitive BooleanField If false ignores the case of characters when searching for the find pattern.

Outputs

Output Output Type Notes
Replaced result File

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
14 Error File not found
18 Warning Pattern not found
15 Error Invalid destination
16 Error Overwrite error
2 Error The task failed

Get File

Find a file on the local file system and create it as an output

Inputs

Input Type Detail Notes
Input File FileField The file to retrieve and create as an output
Data Type DropdownField The content type of the file

Outputs

Output Output Type Notes
File Info Json
File File

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error File was not found

Get File/Folder Info

Get the file system information for a file or folder. This command will always be successful, and the property 'exists' will be false if the file or folder is not found.

Inputs

Input Type Detail Notes
File/Folder FileField The file/folder of which to retrieve information

Outputs

Output Output Type Notes
File/Folder Info Json

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully

Gunzip File

Unzips a file using gunzip

Inputs

Input Type Detail Notes
Input File FileField Gzipped file to be unzipped

Outputs

Output Output Type Notes
Gunzipped File File

Exit Codes

Code Type Detail
0 Success The command completed successfully
1 Error The command failed.

Gzip File

Compresses a single file using gzip

Inputs

Input Type Detail Notes
Input File FileField The file to be compressed

Outputs

Output Output Type Notes
Gzipped File File

Exit Codes

Code Type Detail
0 Success The command completed successfully
1 Error The command failed.

List Directory

List the content of a directory

Inputs

Input Type Detail Notes
Path TextField Path of the directory to list
Output format DropdownField Format of the task output. Full includes header and summary information.

Outputs

Output Output Type Notes
Found files list Array
Result file File

Exit Codes

Code Type Detail
0 Success Indicates that the task was completed successfully
1 Error One or more arguments are invalid
14 Error The directory could not be found

List File Content

List contents of a file

Inputs

Input Type Detail Notes
File name FileField The file to inspect
Preview lines NumberField For large files, you can specify the first N lines to preview of the file. NOTE: Max file size is still a limit to what is printed
Offset NumberField The line number to start the preview at. This is 0 based, so to print from the beginning of the file use the value 0.

Outputs

Output Output Type Notes
File File
File text String

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
14 Error File not found
20 Warning File is too large or not human-readable

Make Directory

Creates a directory

Inputs

Input Type Detail Notes
Directory TextField The name of the directory to create

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
15 Error Failed to create directory
16 Error The remote directory already exists

Move

Moves files / directories

Inputs

Input Type Detail Notes
Source TextField Name of the files/directories to move. Use the wildcard characters * and ? to match multiple files/directories.
Destination TextField Specifies the new location of the file/directory. The Move Command does not support UNC paths on a Windows files system. Utilize the Copy and Delete Commands instead.
Overwrite BooleanField If checked overwrite existing files. When unchecked the task will exit without overwriting existing files.

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
2 Error The task failed
14 Error The source file was not found

Split File

Splits a file into multiple files based on a line count, byte size or regex delimiter

Inputs

Input Type Detail Notes
Input File FileField The file to split into multiple files.
Split Type DropdownField The method used to split the file
Value TextField This is the value to use when splitting the file. For bytes, it will split the file into chunks of files with a maximum of this many bytes. For lines, each file will have a maximum of this many lines. For RegExp, when a line is encountered that matches this regular expression, a new file chunk will be created and optionally include the line that matched the regular expression.
Include RegExp Match BooleanField If RegExp was selected for the Split Type, use this option to include the line that matched in the next file. If this is not checked, all lines that match the regular expression will be excluded from the resulting file chunks.

Outputs

Output Output Type Notes
Split File Chunks File
Number of Files Integer

Exit Codes

Code Type Detail
0 Success The command completed successfully
1 Error The command failed.

Strip Lines

Removes lines from a file according to the line numbers provided

Inputs

Input Type Detail Notes
Source File FileField File from which lines will be stripped
Lines to Strip ArrayField A list of lines to strip. You may use individual lines (i.e. 3) or ranges i.e. (3:10). For example, 3:10 would mean that lines 3 through 10 would be removed from the file and 3: would mean that lines 3 through the end of the file would be removed.

Outputs

Output Output Type Notes
Strip Lines Output File File

Exit Codes

Code Type Detail
0 Success Indicates that the command completed successfully
1 Error Invalid arguments
2 Error General failure

Tar

Creates a tar archive

Inputs

Input Type Detail Notes
Archive name TextField Name of the tar archive to create
Source files FileField Name of files/directories to add to the tar archive. Use comma and/or wildcards to specify multiple files/directories.
Overwrite BooleanField If true an existing archive is overwritten by this task.

Outputs

Output Output Type Notes
Tar archive File

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
16 Error Failed to create archive

UTF-8 Encode

Converts a file to be encoded in UTF-8

Inputs

Input Type Detail Notes
Source File FileField Name of the files/directories to move. Use the wildcard characters * and ? to match multiple files/directories.
Source Encoding TextField The encoding of the source file. (e.g. utf-16, utf-8, windows-1251)

Outputs

Output Output Type Notes
UTF-8 File File

Exit Codes

Code Type Detail
0 Success The command completed successfully
1 Error One or more arguments are invalid
2 Error The command failed

Untar

Unpacks a tar archive

Inputs

Input Type Detail Notes
Archive TextField Name of the tar archive to unpack
Destination TextField Name of the directory to unpack the archive to
Overwrite BooleanField If true existing files are being overwritten when unpacking the archive.
File Gzipped BooleanField Select this option if your tar archive is gzipped

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
14 Error Archive not found
16 Error Overwrite error
2 Error Failed to unpack archive

Unzip

Unpacks a zip / gzip archive

Inputs

Input Type Detail Notes
Archive FileField Name of the zip archive to unpack
Destination TextField Name of the directory to unpack the archive to.
Overwrite BooleanField If true existing files are being overwritten when unpacking the archive.

Outputs

None

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
14 Error The archive could not be found
16 Error Overwrite error
2 Error Failed to unpack archive

Zip

Creates a zip, gzip or gzip+tar archive

Inputs

Input Type Detail Notes
Archive name TextField Name of the archive to create. The compression algorithm is determined from the extension. Use .zip/.z for zip, .gzip/.gz for gzip and .tgz for tar+gzip.
Source files FileField Name of files/directories to add to the tar archive. Use comma and/or wildcards to specify multiple files/directories.
Overwrite BooleanField If true an existing archive is overwritten by this task.

Outputs

Output Output Type Notes
Zipped file File

Exit Codes

Code Type Detail
0 Success Indicates that the task completed successfully
1 Error One or more arguments is invalid
16 Error Failed to create archive
B
Brian is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.