Insert Content
ActionStep Reference » Windows » File » Insert Content
The ActionStep File Insert Content adds a new string either before or after a specified string in a text file.
- Open the Windows node in the Workspace Explorer.
- Open the File node, select the Insert Content ActionStep.
Parameters:
The ActionStep 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:
Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep 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] |
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.