AppendFromFile

Top  Previous  Next

 

The AppendFromFile command allows you to add text in a specified source file to an existing text file. A common use for this is to automatically create or update an external script for another application that can itself be run from the current Pipeline Runner script.

lamp Important: If the specified source or target files are not text files, the text will not be written and an error will be thrown.

Command Syntax

 

AppendFromFile:[SourceFileName],[TargetFileName],[NewLineOption]

 

The colon after the command and the comma between parameters are compulsory. Any additional spaces or characters will cause an error to be thrown. The command itself is not case sensitive, but parameters may be depending on the operating system and locale.

 

Parameters:

 

SourceFileName: The fully qualified path and file name of the file from which the text to be appended should be retrieved

TargetFileName: The fully qualified path and file name of the file to which the text should be appended

NewLineOption: Text equivalent to a member of the NewLineOption enumeration which determines whether the text has new lines before or after the appended text.

 

The SourceFileName and TargetFileName parameters are compulsory. If either parameter is missing an error will be thrown.

 

The NewLine parameter is optional. Valid values are:

 

None - no new line characters will be added. If you do not specify a parameter this is the default setting.

NewLineAfter - the NewLine character or character set for the current operating system will be added after the new text.

NewLineBefore - the NewLine character or character set for the current operating system will be added before the new text.

NewLineBeforeIfNotPresent - the NewLine character or character set for the current operating system will be added before the new text .

NewLineBeforeAndAfter - the NewLine character or character set for the current operating system will be added before and after the new text.a blank line will be added before  the remark text.

NewLineBeforeIfNotPresentAndAfter - the NewLine character or character set for the current operating system will be added before the new text if a Newline character does not already exist, and a further NewLine will be added after the text.

 

The SourceFileName and TargetFileName parameters must be surrounded by quotation marks.

 

Example:

 

Append text only:

 

AppendFromFile:"C:\Source Text.txt","C:\Test Text.txt",None

 

Append text with a blank line before and after:

 

AppendFromFile:"C:\Source Text.txt","C:\Test Text.txt",NewLineBeforeAndAfter

 

See Also: Special Functions Variables Subs