Multi File Syntax
CCH Tagetik allows you to use, in certain scenarios, an advanced syntax to specify the files to be processed.
Note:
When using this syntax for file retrieval, the following parameters must already be defined:
- File type: Specifies the type of file that will be considered in the process (e.g. CSV, XLS, XLSX, etc.).
- Base folder: Defines the starting point for searching and retrieving files.
It is usually possible to specify these parameters; some tools work with these parameters pre-set.
From here on, files corresponding to the requested type will be called 'requested'.
The syntax for file recovery offers two main modes:
- Specific file: allows you to indicate a specific file with its full name including the extension.
- File with partial name: allows the use of a partial name pattern to select multiple files.
In both cases, one or more files can be specified. File names must be separated by a semicolon (;) (e.g.: file1.csv;file2.csv).
Dynamic syntax structure¶
Dynamic syntax must be enclosed in square brackets (\[ \]) and consists of three elements:
- Recursion on subfolders (optional):** By using '**/', the file search will be extended to all sub-folders. If not specified, only files in the defined folder will be processed.
- File template Allows you to specify a template for selecting the required files. For example, 'data*.csv' identifies all files starting with 'date' and ending with the extension '.csv'.
- ZIP file recursion (optional): Using '/**', the search for 'required' files is performed on the entire contents of the ZIP archives, including any nested ZIPs. If not specified, only files in the root of ZIP archives will be processed.
File Recovery Syntax¶
- Specific Files Specifies one or more files using the exact name and extension, separated by a semicolon (';') (e.g.: 'data1.csv;sales.csv').
- ZIP files Specifies one or more ZIP files with an extension, separated by a semicolon (';') (e.g.: 'collection.zip;archive.zip'.
-
Filters
-
'[filename*.csv]': Retrieves all files starting with 'filename' and ending with '.csv' in the defined folder.
- '[archive*.zip]': Retrieves all requested files by searching the root of ZIP files starting with 'archive' and ending with '.zip' in the defined folder.
-
Recursive Filters
-
'[**/filename*.csv]': Retrieves all files starting with 'filename' and ending with '.csv' in the folder and all subfolders.
- '[archive*.zip/**]': Searches all ZIP files starting with 'archive' in the defined folder, retrieving all required files that are contained in these ZIP files.
- '[**/archive*.zip/**]': Searches all ZIP files starting with 'archive' in the defined folder and subfolders, retrieving all requested files that are contained in these ZIP files.
- Combined Syntax
File names and filter syntax can be merged using semicolon (';'). For example: 'collection.csv;[archive*.zip/**]'. - Special Syntaxes The dynamic syntax provides three special strings that do not require square brackets and should be used with care:
- '*': All requested files in the defined folder and the root of the ZIP files in the defined folder.
- **': All requested files in the defined folder, subfolders and the root of the ZIP files in the defined folder and all subfolders.
- '**/**': All requested files in the defined folder, subfolders and all contents of ZIP files (including nested ZIPs).
Best Practices:
When using recursive expressions, it is advisable to minimise the number of folders to be processed. A good practice is to create a dedicated folder in which to copy the structure of files and folders of interest. This is beneficial both for improving performance, especially with the FTP protocol, and for preventing the processing of unwanted files.
Note:
- If a file of a certain type is retrieved through the syntax (e.g. XLS) but the content of the file does not comply with the extension (e.g. is a txt) an incorrect MIME type error will be reported).
- If, depending on the type of file requested, no files are retrieved, an error will be generated indicating that no data is available (e.g. xLS-type files are requested, but are not present).
Examples:
| Syntax | Search path | ZIP Content | Description |
|---|---|---|---|
data1.csv;sales.csv |
specified folder | no | exact file name match |
collection.zip;archive.zip |
specified folder | zIP file root only | Requested files contained in ZIP files with exact name |
[filename*.csv] |
specified folder | no | Files whose names begin with 'filename' and end with '.csv'. |
[archive*.zip] |
specified folder | zIP file root only | Requested files contained in ZIP files with partial name/ wildcard. |
[**/filename*.csv] |
specified folder and all subfolders | no | Files whose names begin with 'filename' and end with '.csv'. |
[archive*.zip/**] |
specified folder | subfolders and nested ZIP files | Requested files contained in ZIP files with partial name/wildcard. |
[**/archive*.zip/**] |
specified folder and all subfolders | subfolders and nested ZIP files | Requested files contained in ZIP files with partial name/ wildcard. |
* |
specified folder | zIP file root only | All files requested |
** |
specified folder and all subfolders | zIP file root only | All files requested |
**/** |
specified folder and all subfolders | subfolders and nested ZIP files | All files requested |