Running a pipeline with NOWAIT

Pipelines v1.6

 

.* Example by TenFiftyTwo(c).

Home

 
.* The following pipeline selects '.ppl' files from the 'Processing multiple files' directory, and for
.* each file found, it launches the pipeline: 'Locate and file.ppl' with the name of the string to
.* locate: 'specs'.
 
.* The pipeline: 'Locate and file.ppl' performs the actual search and for each record which matches,
.* the pipeline writes a record to the output file.
 
.* This example is intended to illustrate how the Runpipe stage command can be used to launch another
.* pipeline with arguments that substitute stage keywords and argument values.
 
pipe (endchar @)
     filelist noh                                                 .* No header.
              drv=&installdrive                                   .* Search drive C.
              path="&installpath\Examples\Processing multiple files"
              ext=ppl                                             .* Select '.ppl' files.
     | specs w5-* 1                                               .* Discard filelist stats.
 
     .* Enclose filename in quotes, specify the 'string' and 'all' keywords, the actual pattern to
     .* locate ‘specs’ and the name of the output file to which to write the matching records.
     .* Note. The excessive formatting is only needed in order to present the data in a read-easy
     .* fashion.
 
     | specs /"&installdrive:\&installpath\Examples\Handle Arguments\Locate and file"/ 1
             /"/ nw                                               .* Enclose the..
             1-* n                                                .* ..filename..
             /"/ n                                                .* ..in quotes.
             x0a n
             / / nw.10 /string/ n                                 .* Search for a string..
             x0a n
             / / nw.10 /all/ n                                    .* ..in all the records..
             x0a n
             / / nw.10 /specs/ nw                                 .* ..that contain the word ‘specs’.
             x0a n
             ws /\./                                              .* Build the output
             / / nw.10 /”&sysdrive:\Documents and Settings\&username\My Documents\/ n
             w-2 n                                                .* ..filename and..
             /.txt/ n                                             .* ..extension, enclosed..
             /"/ n                                                .* ..in quotes.
     | a: fanout                                                  .* Copy to second pipeline.
     | specs /Executing:/ 1 
             ws /"/ w1 nw                                         .* Extract the target pipeline.
             x0a n                                                .* Display.
             /with arg:/ n.9 right                                .* Extract and display..
             w2-* nw                                              .* .. the argument.
             x0a n                                                .* Display a blank line.
     | cons                                                       .* Tell the user.
     @
     a:
     | runpipe nowait                                             .* Launch the pipeline.