FILEAPPEND (>>) stage v1.2

Pipelines v2.1

 

Purpose, Operands, Streams, Usage, Examples, Related

Home

 

Syntax

 

>>───FILEAPPend──────────────────────────────────────────────────────────────────><
    └─>>─────────  filename─┘

 

Purpose

 

Use the FILEAPPEND stage to write to (append to, or create) a disk file.

 

FILEAPPEND reads records from its primary input stream and writes them to the specified file and to its primary output stream, if it is connected. FILEAPPEND appends a Line-Feed character to each output record that it writes to the specified file, primary output stream records are written unchanged. If the file already exists, FILEAPPEND appends the records. If the file does not exist, FILEAPPEND creates a new file. To append to an existing file, you must specify a fully qualified directory path, otherwise, a new file will be created in the current working directory.

 

Without the filename operand, each time FILEAPPEND reads an input record; it extracts the first word or quote (“) delimited phrase and uses this as the name of the target output file.  The remainder of the input record data is used as the record which is written to the specified output file and to the primary output stream, if it is connected. If you do not specify a fully qualified path, FILEAPPEND creates or appends to the specified output file in the current working directory.

 

Operands

 

filename

is the name of the file to be created or to which data is to be appended.

 

Streams

 

The following streams are used by the FILEAPPEND stage:

 

Stream

 

Action

 

 

Primary input stream

FILEAPPEND reads records from its primary input stream.

Primary output stream

FILEAPPEND writes its primary input stream records to its primary output stream.

 

Usage

 

1.

FILEAPPEND does not delay the records.

 

2.

If multiple instances of the FILEAPPEND stage operate on the same output file at the same time, the contents of the file will be unpredictable.

 

3.

If the target filename contains spaces; you must enclose it in quotation marks. For example:

 

'pipe literal /”my file.txt” some data/ | >>'

 

4.

FILEAPPEND verifies that its secondary output stream is not connected and then begins execution.

 

Examples

 

The following pipeline reads records from the console and appends them to the file: myfile.txt. If myfile.txt does not already exist, FILEAPPEND creates it.

 

'pipe console | >> myfile.txt'
 

Related

 

CONSOLE, FILEIN (<), FILEOUT (>), IN, OUT

 

History

 

Version

 

Date

Action

Description

Pipelines

1.2

24.12.2021

changed

Application-wide rewrite.

2.1

1.1

09.10.2007

added

Without the filename operand, each time FILEAPPEND reads an input record; it extracts the first word or quote (“) delimited phrase and uses this as the name of the target output file.  The remainder of the input record data is used as the record which is written to the specified output file and to the primary output stream, if it is connected. If you do not specify a fully qualified path, FILEAPPEND creates or appends to the specified output file in the current working directory.

1.2

1.0

06.09.2007

created

First version.

1.0