FILES

Synopsis

HELP:   List files with output name mapping
TYPE:   OBJECT
SYNTAX: FILES(INPUT['str'...],EXCLUDE['str'...],OUTPUT='str',FORMAT=OUT/TAB/IN/CSV)

Description

The FILES object selects files matching one or more INPUT patterns (wildcards allowed), optionally excluding files that match any EXCLUDE pattern, and prints the matched filenames to the output stream.

The output format is controlled by the FORMAT parameter. The default format OUT prints one output filename per line. When OUTPUT is not specified, the output filename equals the input filename (identity mapping via the implicit [copy] token). The OUTPUT parameter uses pat2str tokens such as [path], [name], [ext], [copy], [upper], [lower], [search=replace], [indN], and others to construct the output name from the input path.

INPUT

File pattern(s) to include. Wildcards are supported. The parameter is repeatable (array); at least one value is required. For multiple input patterns, all matching files from all patterns are listed.

EXCLUDE

Wildcard pattern(s) for files to exclude from the result. Repeatable (array). Files whose names match any EXCLUDE pattern are not printed. If no EXCLUDE is given, no files are excluded.

OUTPUT

Output filename pattern using pat2str tokens. When not provided, each file is listed with its own name (identity mapping). Common tokens:

FORMAT

Controls the output format for each matched file. Accepted values:

The default OUT format is suitable when only the list of target names is needed. Use TAB or CSV to inspect how the OUTPUT pattern maps each input to its output. Use IN when only the input paths matter (equivalent to LIST but with multi-pattern support).

EXAMPLES
flcl UTIL run.files(input='/data/*.xml' output='[path]/out/[base].fix')
flcl UTIL run.files(input['/a/*.xml','/b/*.dat'] exclude='*.tmp' output='[path]/out/[base].[ext]')
flcl UTIL run.files(input='*.txt' format=TAB output='[path]/out/[base].[ext]')
flcl UTIL run.files(input='*.txt' format=CSV output='[name]')
flcl UTIL run.files(input='*.txt') out=filelist.txt

Arguments