SetVarFromTextFile: Assign the text content of a file to a variable.

File encoding is automatically detected among the following:

  • UTF8 with BOM

  • UTF8

  • UTF16 LE with BOM

  • UTF16 BE with BOM

  • ASCII/ANSI (default)

Tag Attributes

Attribute Name

Attribute Value

Name

Any unreserved name. Reserved name are listed on: Variables - Required

FilePath

Input file path.

ExecuteInPreset

TRUE / FALSE (Defaults to FALSE)

TRUE also runs this action while the Job preset is created (sapio365 only).

Example script

XML
<ytriaAutomation Application="sapio365">
    <SetVarFromTextFile Name="MyVarFromFileUTF8" FilePath="C:\utf8.txt"/>
    <Echo Value="{%MyVarFromFileUTF8%}"/>
    <SetVarFromTextFile Name="MyVarFromFileUTF16" FilePath="C:\utf16.txt"/>
    <Echo Value="{%MyVarFromFileUTF16%}"/>
</ytriaAutomation>