DUPLICATE stage v1.0

Pipelines v1.9

 

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

Home

 

Syntax

 
                _1______
>>__DUPlicate__|________|______________________________________________________________><
               |_copies_|
               |_ALL____|
               |_*______|
               |_-1_____|

 

Purpose

 

Use the DUPLICATE stage to write each input record in addition to the specified number of copies of each input record. DUPLICATE reads records from its primary input stream and writes records to its primary output stream, if it is connected. It does not discard null input records.

 

Operands

 

    

copies

is an unsigned integer which specifies the additional number of input records to duplicate. A positive number or 0 must be specified for copies, which causes DUPLICATE to write the original record to its output stream. If you do not specify copies, DUPLICATE writes 1 additional copy of each input record.

 

    

ALL

*

specifies an infinite number of copies of the input stream. When you specify DUPLICATE *, the first input record is the only one duplicated because it is the only one ever read.

 

    

-1

specifies that all input records are consumed and no output is written to the output stream.

 

Streams used

 

The following streams are used by the DUPLICATE stage:

 

Stream

Action

 

 

Primary input stream

DUPLICATE reads records from its primary input stream.

Primary output stream

DUPLICATE writes to its primary output stream the original record plus the specified number of copies of each record read from its input stream.

 

Usage notes

 

     1)

DUPLICATE does not delay the records.

 

     2)

If the DUPLICATE stage discovers that its primary output stream is not connected, the DUPLICATE stage ends.

 

     3)

DUPLICATE verifies that its secondary input and output streams are not connected and then begins execution.

 

Examples

 

The following pipeline generates an additional 3 copies of its input data.

 

C:\>pipeliteral /a string/ | duplicate 3 | console
a string
a string
a string
a string
 

See also

 

Reference the following link for additional information:

 

BUFFER