XenoGuard Documentation

Insert Content

Actions » Windows » File » Insert Content 

The action Insert Content adds a new string either before or after a specified string in a text file.

[-] Hide
  1. Open the Windows node in the Workspace Explorer.
  2. Open the File node, select the Insert Content action.

Parameters:

The action has the following input parameters:


name Description
Path Name
The path name of the file where content is to be inserted.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Encoding
Specifies the character encoding used for the content.

Available character encoding schemes: ASCII, ANSI, UTF-8, UTF-8-BOM, Unicode

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Operation
The position of the string to be inserted.

Allowed Values: "Insert Before" and "Insert After"

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]
Insertions
Specifies the character encoding used for the content.

Parameters for the "Insertion" sub-branch:

  • Search String - the string where a new string is to be added
  • Insert String - the string to be added
  • Start New Line - adds a new line after the inserted string
Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Results:

The action returns the following results:


name
description
Count Insertions
The total number of inserted items in the file.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types 
[Variable, Parameter]

Warning An Exception Error occurs when the index and length of the string to be inserted are not within the specified location of the string.

Example 1 (Insert domain name for an email list):

This example creates a local variable named Domain with Text as data type. The value of the variable is then inserted after the "@" symbol to create an email list in the text file. The number of inserted strings are displayed in Message Box.

See other file operations: