RenameFile |
Top Previous Next |
×V3.1Ø
Syntax - RenameFile {<SourceFilePathAndName>|InputFile|LogFile|} <DestinationFileName> Where: <SourceFilePathAndName> is a literal string or a variable that contains a string. InputFile is a keyword that identifies the file defined in the SetStartup InputFile command or in the OPTIONS command. LogFile is a keyword that identifies the file defined in the SetStartup LogFile command. <DestinationFileName> is a string or variable containing a string Description: This command instructs EMUE to rename the file defined by <SourceFilePathAndName>. <SourceFilePathAndName> is a valid path and file name that is accessible from the workstation on which EMUE is running.The file remains in the same directory, but the file name and/or extension may be changed. EMUE can rename files on an FTP server in addition to local and network files. The key term #TODAY# can be used in the literal string that defines the <DestinationFileName> to insert the current date in file name. The key term #TODAY# is replaced with the current date in the format MMDDYY. The key term #TIME# can be used in the literal string that defines the <DestinationFileName> to insert the current time in file name. The key term #TIME# is replaced with current time in the format HHMMSS. The key term #INPUTFILENAME# can be used in the literal string that defines the <DestinationFileName> to insert the file name defined in the SetStartup InputFile command into the file name. The key term #INPUTFILENAME# is replaced with the file name defined in the SetStartup InputFilecommand without its extension. The key term #SCRIPTFILENAME# can be used in the literal string that defines the <DestinationFileName> to insert the script file name without extension into the file name. The key term #SCRIPTFOLDER# can be used in the literal string that defines the <DestinationFilePathAndName> to insert the folder path where the script file is located. The key term #COMPUTERNAME# can be used in the literal string that defines <DestinationFilePathAndName> to insert the name of the computer where the script is running. The key terms #TODAY#, #TIME#, #SCRIPTFILENAME# and #INPUTFILENAME# can also be used to identify the source file. 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 renaming the log file, the keyword LogFile should always be used so that EMUE will continue to handle the file as the log file.
Sample: The following changes the specified file's name to include a date and time stamp. The file will remain in the same directory. RenameFile "C:\EMUE\Script1\RawFiles\CDM0428.txt" "CDM0428_#TODAY#_#TIME#.txt"
See Also:
|