running-a-pipeline-with-nowait.rex |
Pipelines v2.1 |
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10... |
**** Top of file ****
1
2 /* The following pipeline selects '.rex' files from the 'processing-multiple-files' directory, and for
3 each file found, it launches the pipeline: 'locate-and-file.rex' with the name of the string to
4 locate: 'specs'.
5
6 The pipeline: ‘locate-and-file.rex' performs the actual search and for each record which matches;
7 the pipeline writes a record to the output file.
8
9 This example is intended to illustrate how the Runpipe stage command can be used to launch another
10 pipeline with arguments that substitute stage keywords and argument values. */
11
12 Address Rxpipe
13
14 pipe (endchar @)',
15 'filelist noh', /* No header. */
16 'drv=&installdrive', /* Search drive C. */
17 'path="&installpath\examples\processing-multiple-files"',
18 'ext=rex', /* Select '.rex' files. */
19 '| specs w5-* 1', /* Discard the filelist stats. */
20 ,
21 /* Enclose filename in quotes, specify the 'string' and 'all' keywords, the actual pattern to
22 locate 'specs' and the name of the output file to which to write the matching records. */,
23 ,
24 '| specs /"&installdrive:\&installpath\examples\subroutine\locate-and-file.rex"/ 1',
25 '1-* nw /,/ nw', /* ..filename.. */
26 '/string/ nw /,/ nw', /* Search for a string.. */
27 '/all/ nw /,/ nw', /* ..in all the records.. */
28 '/specs/ nw /,/ nw', /* ..that contain the word 'specs'. */
29 'ws /\./', /* Build the output */
30 '/"&sysdrive:\Documents and Settings\&username\My Documents\/ nw',
31 'w-2 n', /* ..filename and.. */
32 '/.txt"/ n', /* ..extension, enclosed in quotes */
33 '| a: fanout', /* Copy to second pipeline. */
34 '| specs /Executing:/ 1',
35 'ws /"/ w1 nw', /* Extract the target pipeline. */
36 'x0a n', /* Display. */
37 '/With args:/ n', /* Extract and display.. */
38 'w2-* nw', /* .. the argument. */
39 'x0a n', /* Display a blank line. */
40 '| cons', /* Tell the user. */
41 '@',
42 'a:',
43 '| runpipe nowait' /* Launch the pipeline. */
44
45 Say 'Hit Enter to close..'
46 Parse Pull
47
48 Exit 0
**** End of file ****
|