searching-for-multiple-words.rex

Pipelines v2.1

 

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

Home

     **** Top of file ****
   1
   2 /* The following pipeline reads the file: winston.txt and performs a non-case sensitive search for
   3    records that contain both of the words: 'Winston' and 'stairs' and records that contain the
   4    word 'face' but not the word 'pictures'.
   5    For each record that matches, the pipeline produces an output record comprising the record number,
   6    followed by the record. */
   7
   8 Address Rxpipe
   9
  10 'pipe (endchar ?)',
  11      '< &installdrive:\&installpath\examples\input\winston.txt',
  12      '| specs recno 1 1-* nw',                        /* Record number in col 1.. */
  13         ,                                             /* ..followed by record. */
  14      '| a: fanout',
  15      '| locate anycase w2-* /Winston/',               /* Select record if word is found. */
  16      '| locate anycase w2-* /stairs/',                /* Select record if word is found. */
  17      '| b: faninany',                                 /* Merge the streams. */
  18      '| console',                                     /* Display record on console. */
  19      '?',
  20      'a:',
  21      '| locate anycase w2-* /face/',                  /* Select record if word is found. */
  22      '| nlocate anycase w2-* /Pictures/',             /* Do not select record if word is found. */
  23      '| b:'                                           /* Route back to main pipeline. */
  24
  25 Say 'Hit Enter to close..'
  26 Parse Pull
  27
  28 Exit 0
     **** End of file ****