>> (FILEAPPEND) stage v1.1

Pipelines v2.0

 

Purpose, Operands, Streams used, Usage notes, Examples, See also

Home

 

Syntax

 

>>__ _>>_________ __ __________ _______________________________________________________><
    |_FILEAPPend_|  |_filename_|

 

Purpose

 

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

 

>> reads records from its primary input stream and writes them to the specified file and to its primary output stream, if it is connected. >> 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, >> appends the records. If the file does not exist, >> 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 >> 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, >> 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 used

 

The following streams are used by the >> stage:

 

Stream

Action

 

 

Primary input stream

>> reads records from its primary input stream.

Primary output stream

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

 

Usage notes

 

     1)

>> does not delay the records.

 

     2)

If multiple instances of the >> 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:

 

**** Top of file ****
01 Address Rxpipe
02
03 ‘pipe literal /”my file.txt” some data/ | >>’
04
05 Exit 0
**** End of file ****

 

     4)

>> 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, >> creates it.

 

**** Top of file ****
01 Address Rxpipe
02
03 ‘pipe console | >> myfile.txt’
04
05 exit 0
**** End of file ****
 

See also

 

Reference the following links for additional information:

 

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

 

History of change

 

Version

Action

Description

 

 

 

1.1

Added

Without the filename operand, each time >> 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, >> creates or appends to the specified output file in the current working directory.