File name patterns

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.

Using file name patterns with the FileInput, CDInput, and FTEInput 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.

The match might be with a file name or a character sequence (a pattern). A pattern is a sequence containing at least one of the following wildcard characters:
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.
The default pattern is *, which matches all file names.

You cannot specify file names that contain the following characters: the asterisk ('*'), the question mark ('?'), or file name separator characters ('/' and' \').

For example:
  • If you want the FileInput node to process all files that have a certain extension, such as xml, set its File name or pattern property to *.xml and the node will process all files in the directory (and subdirectories if selected) that have this extension.
  • If you want the FileInput node to exclude all files with a certain extension from being processed, such as .csv, set its File exclusion pattern property to *.csv and the node will not process any of the files with this extension in the directory (and subdirectories if selected).

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.

Pattern matching

The FileInput, CDInput, and FTEInput nodes set the LocalEnvironment.Wildcard.WildcardMatch element to the string matched by wildcards in the file name. The LocalEnvironment.Wildcard.WildcardMatch element is unaffected by file exclusion patterns. The following are some examples of pattern matching with the value in this element, where the value in the FileInput node's File name or pattern property is File????.from*.xml:
  • If the FileInput node finds a file with the file name File1234.fromHQ.xml, there is a match. The value in the LocalEnvironment.Wildcard.WildcardMatch element is set to 1234.fromHQ and the node processes the file.
  • If the file name is File123.fromHQ.xml, there is no match because there are insufficient characters between the File and .from elements of the file name. The FileInput node ignores this file.
  • If the file name is File2345.from.xml, there is a match. The value in the LocalEnvironment.Wildcard.WildcardMatch element is set to 2345.from and the node processes the file. In this example, the * in the character string in the File name or pattern property matches a string of zero characters. If you require the character string between the from and .xml elements of the file name to always have at least one character, you specify the File name or pattern property with a value of File????.from?*.xml.

Using file name patterns with the FileOutput, CDOutput, and FTEOutput nodes

The node writes messages to files that it creates or replaces in the integration node's file system. Only patterns containing a single wildcard character (the asterisk, '*') are allowed in this property. The file name to be used is determined in the following way:
  • If the file name property contains no wildcard, the value of this property is the name of the file created. This value must be a valid file name on the file system that hosts the integration node to which the message flow is deployed.
  • If the file name property contains a single wildcard, the value of the element LocalEnvironment.Wildcard.WildcardMatch in the current message replaces the wildcard character, and the resulting value is the name of the file created. This value must be a valid file name on the file system that hosts the integration node to which the message flow is deployed. If the WildcardMatch value is not found, the wildcard character is replaced by the empty string.
You cannot specify file names that contain the following characters: the asterisk ('*'), the question mark ('?'), file name separator characters ('/' and' \'). The name of the file can be overridden by values in the current message.

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 integration node 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.

FTP, FTPS, and SFTP considerations

You can use the FileInput node to transfer files from a remote FTP, FTPS, or 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, FTPS, or SFTP server. If your integration node 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, FTPS, 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 integration node 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, FTPS, 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, FTPS, or SFTP server. Only files with names that match the pattern specified in the node are written. If your integration node 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, FTPS, 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 integration node where you specified the file name pattern is running, the file is not transferred from the FTP server for processing by the FileInput node.