Skip to content

gather.m

Calvin Eiber edited this page Jun 30, 2021 · 1 revision

LIST = tools.gather(SOURCE,PATTERN)

Recursively search the folders specified by SOURCE for files matching PATTERN; return these files as LIST. if PATTERN is a function handle, recursively apply that function handle to the files in SOURCE and every subdirectory of SOURCE (no direct output will be generated).

Source may be:

  • a TABLE containing 'subject' (and optionally 'sample')
  • a STRUCT containing 'name' and 'folder' (see dir)
  • a STRING path or tools.file path, input to dir()

this is similar to (and in many cases can be replaced with) a call like dir([tools.file('~\primary\') '/**/' PATTERN ])

tools.gather is part of package +tools

Clone this wiki locally