File Input & Output Reference
This page describes built-in Touch Portal File Input & Output actions, events and states. For other automation options, see the Touch Portal Capability Model.
File Input & Output Actions
Write To File
Action settings
File
The file to write to
Text
The contents written to the given file
This action allows you to write content to a file. The file is cleared of contents before writing.
Note: This will write the file using UTF-8 encoding.
Action
2.2
Available since
Append To File
Action settings
File
The file you want to append to
Text
The text you want to append
This action allows you to append text to the given file
Note: This expects the file to be in UTF-8 encoding and will be saved as such as well after appending.
Action
2.2
Available since
Create File
Action settings
File
The file you want to create.
This action allows you to create a file. If the specified file already exists on disc then this action will fail silently.
Action
3.0.11
Available since
Delete File
Action settings
File
The file you want to delete.
This action allows you to delete a file. If the file does not exist this action will fail silently.
Note: The action expects that Touch Portal has the rights to delete files from the disc. If the OS prevents this or the file is locked, this action will fail. Cloud synced file may not be deleted properly by this action, read the manual of the cloud syncing software to see the requirements to correctly delete the given file.
Action
2.2
Available since
Copy File
Action settings
Source
Source file.
Destination
Destination folder or destination file path.
Overwrite
Overwrite if existing or not
Copy a file to another location. Destination can be a folder or a file path (rename). Optional overwrite.
Action
4.5
Available since
Move File To Folder
Action settings
File
Source file to move.
Folder
Destination folder to move the file in.
Move a file to a folder. The destination must be a folder path. The target file must not already exist.
Action
4.5
Available since
Rename File
Action settings
File
Source file.
String
New name (must not exist).
Rename a file. The target needs to be the new filename including the extension.
Action
4.5
Available since
Insert / Replace Line In File
Action settings
Action
Insert of replace.
File
The file you want to use.
Line
The line number you want to replace or insert at.
Text
The text to insert or replace at the given line number.
Allows you to insert or replace a line in a file.
Action
4.3
Available since
File To Value
Action settings
File
The file you want the contents of
Value
The Value you want to store into
This action allows you to store the contents of a file into a Value. If the file does not exist nothing will happen. If the file cannot be read, nothing will happen.
Action
2.2
Available since
Get Line Count From File
Action settings
File
The file to get the line count from.
Value
The Value to store the line count into.
This action allows you to the line count from a text file. If the file does not exist nothing will happen. If for some reason the file cannot be read nothing will happen.
Note: This expects the file to be in UTF-8 encoding.
Action
3.0.11
Available since
Get Line From File
Action settings
Line Number
The number of the line in the file.
File
The text file from which the line is retrieved.
Value
The Value into which the retrieved line is set.
This action allows you to get a specified line from a text File. If the file does not exist nothing happens. If the given line number is not a number nothing happens. If the file has less lines than the line number given, the last line is used.
Note: This expects the file to be in UTF-8 encoding.
Action
3.0.11
Available since
Remove Lines From File
Action settings
Line Start
The start line number of the line range you want to remove
Line End
The end line number of the line range you want to remove
File
The file from which you want to remove the lines.
This action allows you to remove lines from a text file.
Note: This action expects the file to be in UTF-8 encoding and will also save the file back with UTF-8 encoding.
Action
4.0
Available since
Url Result To File
Action settings
Url
The url.
File
The file to store the endpoints content in.
This action allows you to get the result of a endpoint (url) and store it into a file
Note: This uses UTF-8 encoding for the file.
Note: The contents can be altered based on newlines and OS specifics
Action
2.3
Available since
Iterate Folder Contents
Action settings
Iterate Option
Whether to iterate sub-folders as well or not.
Folder
Folder to iterate.
This action allows you to iterate through all the files within a specific folder..
Action
4.5
Available since
Copy Folder
Action settings
Source Folder
The folder you want to copy
Destination Folder
The destination to copy the folder to
Copy a folder to another location. Destination folder must not already exist.
Action
4.5
Available since
Rename Folder
Action settings
Folder
Source folder.
String
New name or target folder path (must not exist).
Rename a folder. The target can be a new name (same parent) or a full destination folder path (move+rename).
Action
4.5
Available since
File Input & Output Events
When A File Changes
Event settings
File
The file set up to listen for changes.
This events can be set up to listen when the contents of a file changed.
Note: Wildcards and codes cannot be used in the file field because file listeners are not dynamic and are set when loaded and are directly connected to the specified file.
Event
2.2
Available since