GetFileList |
Top Previous Next |
×V3.1Ø
Syntax - GetFileList <ListName> <FilePattern> Where: <ListName> is the user defined name for the list. <FilePattern> is a path and file name that is accessible from the workstation on which EMUE is running or an FTP server. This path can include wildcards.
Description: This command retrieves a list of files that fit the specified pattern in <FilePattern>. The names of the files are stored in a List that is named <ListName>. If no files are found, an empty list is created. If the file pattern ends with the backslash (\) then the names of all files in the given directory will stored in the list. In addition to storing the name of the file, EMUE also stores the full path, size, creation date, and last modified date. If the named list does not exist, EMUE will create it automatically. It will be created as if the NoVerifyCount option was set. If an existing list is used that already has data in it, the list of files will be appended to the existing list.
When retrieving file names from an FTP server, the file size, creation date, and last modified date will not be available.
The key terms #TODAY#, #TIME#, #SCRIPTFILENAME#, #SCRIPTFOLDER# and #INPUTFILENAME# can also be used to identify files. These keywords should be used carefully. For example, #TIME# is replaced with the current time when this line of the script is run. It is unlikely to match a timestamp in the name of the file. #TODAY# would be useful for a file created with a time-stamp in the same day, but be sure that the date formats match otherwise the file names will not match.
Note: When retrieving a list of files from an FTP server, the results returned by GetFileList can vary from one FTP server to the next. It is best to explicitly include the forward slash (/) at the end of the path to a directory, even though in some cases, it may not be required. When retrieving files from a local directory, any path that does not include a trailing slash will attempt to find a file match in the parent directory. For example, the following line will retrieve a list of all the files in the EMUE directory:
GetFileList FileList "C:\EMUE\"
In contrast, the following line will look for a file named EMUE on the C drive.
GetFileList FileList "C:\EMUE"
Sample 1: In the following sample, the names of all of the files with a .txt file extension will be stored into a list called FileList. GetFileList FileList "C:\EMUE\Script1\*.txt"
Sample 2: In the following sample, the names of all of the files in the directory will be stored into a list called FileList. Notice that there is a backslash (\) after the name of the directory. GetFileList FileList "C:\EMUE\Script1\"
Sample 3: In the following sample, all file that are in the EMUE directory that have a .txt extension are retrieved from an FTP location and stored into the list called FileList. GetFileList FileList "ftp://100.0.0.1/EMUE/*.txt"
|