Read variables action
- Updated: 2024/06/27
Read variables action
Use the Read variables action in the Text file package to read the values of variables from a text file.
- Var1=This is sample English text
- Var2 = test
- Var3 = Tst3
Settings
- In the Source file field, click one of the following tabs to
               specify the location of the text file:- Variable: To open the source text file using a variable.
- Control Room file: To open the source text file from
                     the Control Room.Click Choose to Search, Browse or Upload a text file from Control Room. 
- Desktop file: To open the source text file from your
                     local device.Click Browse to upload the text file. This field also accepts the file path input as a string variable or global value. 
 
- Click the Text encoding drop-down menu and select one of the
               following encoding type to apply on the text file:- Detect automatically: Identifies the file encoding. This option supports UTF-8 with BOM, ANSI, UTF-16LE, and UTF-16BE file encoding.
- ANSI
- UTF-8
- UTF-8 with BOM
- UTF-16LE
- UTF-16BE
- Unicode
- Shift-JIS
- Windows 1251
 Data from the text file is retrieved based on the selected encoding option even if the input file has a different encoding. 
- Select the Trim leading spaces check box to remove the leading space in the data extracted from the text file.
- Select the Trim trailing spaces check box to remove the trailing space in the data extracted from the text file.
- Select the Convert dictionary keys to lower case
                  before assignment to variables check box to convert all the keys to
               lower case.Note: When you select this option, ensure that you enter the key in lower case in the Mapped variables table.
- From the Save the outcome to variable field, click one of the
               following tabs to contain the output:- Multiple variables: Click Add variable
                        mapping to associate each dictionary key with a variable.Use this option to avoid using actions to extract the dictionary values. 
- Dictionary: Insert or create a dictionary
                        variable.Dictionary contains the output variables and values in key-value pairs. While creating a variable, you can use the Add option to create a Key. The variable can be accessed using the corresponding key. 
 
- Multiple variables: Click Add variable
                        mapping to associate each dictionary key with a variable.