You can specify a file name pattern, using wildcard characters, to identify a file to be read by the FileInput, CDInput, and FTEInput nodes. You can also specify a file name pattern, using a single wildcard character, to name the file to be created by the FileOutput and FTEOutput nodes.
The input nodes read files from a specified directory and propagate messages based on the contents of these files. Only files with names that match a pattern (the input pattern), as specified in the FileInput node's File name or pattern property or the FTEInput node's File name filter property, are read.
If you are using file name patterns to exclude files from the FileInput node, files with names that match the exclude pattern, as specified in the FileInput node's File exclusion pattern are not read or processed.
Wildcard character | Description | Example |
---|---|---|
* | Any sequence of zero or more characters | *.xml matches all file names with an xml extension |
? | Any single character | f??????.csv matches all file names consisting of the letter f followed by six characters, then the sequence .csv. |
You cannot specify file names that contain the following characters: the asterisk ('*'), the question mark ('?'), or file name separator characters ('/' and' \').
If you deploy the flow to a Windows server, file names match the pattern irrespective of case. However, if you deploy the flow to a Linux, UNIX, or z/OS® server, file names must match the pattern character string and its case.
If the File name or pattern property on the FileOutput node is empty, the name must be overridden by the current message. Wildcard substitution occurs only if this property is not overridden in this way.
File names are passed to the file system to which the broker has access, and have to respect the conventions of these file systems. For example, file names on Windows systems are not case-sensitive; on UNIX systems, file names that differ by case are considered distinct.
Example: If the FileInput node has *.out in the File name or pattern property, and the incoming file is myfile, the name of the outgoing file is myfile.out.
You can use the FileInput node to transfer files from a remote FTP or SFTP server and process them. Only files with names that match the file name pattern specified in the node are read. You can also use a file exclusion pattern to prevent files from being read on a remote FTP or SFTP server. If your broker is on an operating system that respects case sensitivity (such as UNIX), you might specify a pattern that includes a combination of uppercase and lowercase characters. If you then use this pattern to process files that are in a directory on a remote FTP or SFTP server, and this server is running on an operating system that does not respect case sensitivity (such as Windows), file name matching might fail with the result that no files are processed. This failure occurs because the file names on the remote server are not in mixed case. If your broker is on an operating system that does not respect case sensitivity, any pattern that you specify might be matched by more than one file on a remote FTP or SFTP server that is running on an operating system on which case sensitivity is significant. Each of these files is then processed sequentially.
You can use the FileOutput node to write files to a remote FTP or SFTP server. Only files with names that match the pattern specified in the node are written. If your broker is running on an operating system that respects case sensitivity (such as UNIX), you might specify a pattern that includes a combination of uppercase and lowercase characters. However, if you then use this pattern to write files to a directory on a remote FTP or SFTP server running on an operating system that does not respect case sensitivity (such as Windows), the file name is written in uppercase rather than in the way that it was specified in your pattern.
If the name of a file on a remote FTP server contains one or more characters that are not valid on the operating system on which the broker where you specified the file name pattern is running, the file is not transferred from the FTP server for processing by the FileInput node.