Command Reference

Read Text File

Reads the contents of a text file into a variable.

Action ID: 36
Action Category: Text Files

Settings

Variable name

The name of the variable to store the text file contents in.

File name

The name of the text file to read.

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

Could not read text file.

File not found.
<<File name>>

2

Could not read text file.

Error opening file.
<<File name>>

3

Could not read text file.

The file is too large to be read.
<<File name>>

Example

In this example, we will read all of the text from our "readme.txt" file into a custom variable named %ReadmeText%.

Variable name: %ReadmeText%
File name: %AppDir%\readme.txt

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab