searching-files-for-a-pattern.rex

Pipelines v2.1

 

.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10...

Home

     **** Top of file ****
   1
   2 /* The following pipeline selects '.rex' files from the 'examples' directory, and
   3    for each file found, it launches the pipeline: locate.rex, with the name of the pattern to
   4    locate: '*specs*'.
   5
   6    The pipeline: locate.rex, performs the actual literal search, this pipeline simply
   7    generates the list of files to search.
   8
   9    This example is intended to illustrate how the Runpipe stage command can be used to launch
  10    another pipeline with arguments that substitute stage keywords and argument values. */
  11
  12 Address Rxpipe
  13
  14 'pipe filelist noh',                                             /* No header. */
  15               'drv=&installdrive',                               /* Search the install drive.. */
  16               'subdir',                                          /* ..and sub-directories. */
  17               'path="&installpath\examples"',                    /* Path. */
  18               'ext=rex',                                         /* Generate file list. */
  19      '| specs w5-* 1',                                           /* Discard filelist stats. */
  20         ,
  21         /* Enclose filename in quotes, specify the 'pattern' and '*' keywords and the actual
  22            pattern to locate. */,
  23         ,
  24      '| specs /"/ 1 1-* n /"/ n /,/ nw /pattern/ nw /,/ nw /*/ nw /,/ nw /*specs*/ n',
  25         /* Call the pipeline. */,
  26      '| runpipe "&installdrive:\&installpath\examples\subroutine\locate.rex"'
  27
  28 Say 'Hit Enter to close..'
  29 Parse Pull
  30
  31 Exit 0
     **** End of file ****