reading-multiple-files.rex

Pipelines v2.1

 

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

Home

     **** Top of file ****
   1
   2 /* The following pipeline selects '.txt' and '.ini' files from the 'Examples\Input' directory, and for
   3    each file found (up to three files in total), it displays the contents of each on the console. */
   4
   5 Address Rxpipe
   6
   7 'pipe filelist noh',
   8               'drv=&installdrive',
   9               'path="&installpath\examples\input"',
  10               'ext=(txt,ini)',                   /* Generate file list. */
  11      '| take 3',                                 /* Select only the first 3 files. */
  12      '| specs w5-* 1',                           /* Discard filelist stats. */
  13      '| <',                                      /* Read the file. */
  14      '| xlate ws xff w1 \ xfe',                  /* Change backslashes in the path to x'fe'. */
  15      '| specs ws xfeff w-2 strip 1.16 w-1;* nw', /* Discard the file path, keep filename and record. */
  16      '| console'                                 /* Display the record on the console. */
  17
  18 Say 'Hit Enter to close..'
  19 Parse Pull
  20
  21 Exit 0
     **** Top of file ****