Copy File
|
Copy or move one or more files to another location (for example, to a shared folder where they can
be accessed by your business community).
Review the following for additional information:
-
Source file—Select the file to copy.
In this field, you can also use the asterisk (*) and question mark (?) wildcard characters, as well as variables, in the file name to help you select one or more files (in the same directory) to copy. To use this method:
- Specify the file directory by browsing to and selecting one of the files.
- Then modify the file name in the Source file field using wildcard characters and/or variables.
- Copy to folder—Select the destination folder into which you want to copy or move the file or files.
-
Copy name—To rename the copied or moved file, enter a new name.
Note: This field is only applicable when copying a single source file.
-
Suffix—Select a suffix to append to the file name. Select from the list of existing suffixes, or click to select a variable or build a new suffix using the expression editor.
- Delete source file—Select to move the file from the source folder to the destination folder. Deselect to copy the file to the destination folder.
|
Delete File
|
Delete one or more files from one or more specified locations.
You can also use this activity to delete files that are created previously in the script.
Files to delete—Click Add Files to select one or more files to delete. In the File Collection Editor, do one or both of the following:
-
To delete files created previously in the script, select a file in the left pane and click Add.
Note: When a file name is displayed for selection in the left pane, any variable names that are used in the file name are visible (#MyVariable#), but suffixes are not visible.
-
To select other existing files, click to browse to and select the files.
In this field, you can also use the asterisk (*) and question mark (?) wildcard characters, as well as variables, in the file name to help you select one or more files (in the same directory) to delete. To use this method:
- Specify the file directory by browsing to and selecting one of the files.
- Then modify the file name in the Files to Delete pane using wildcard characters and/or variables.
Note: As an example of using wildcards and variables, using the file name MonthlyReport_#var#*.xls, where #var# is Feb, would delete all reports whose file name begins with "MonthlyReport_Feb" in the same directory.
|
Log Comment
|
Writes a comment to the scripts's log.
Log message—Enter the text of the comment you want to insert into the log when this activity executes.
|
Zip/Unzip Files
|
Create a zip file (compressed folder) and add files to it. You can add files created previously in the script to the zip file. Use this activity to zip multiple files and then attach the zip file to an email using the Email activity.
You can also use this activity to unzip a zip file.
Review the following for additional information:
Zip Tab
- Archive name—Select a location and name for the zip file. You can use a variable in this field by entering the hash symbol before and after the variable name (#VariableName#).
-
Suffix—Select a suffix to append to the file name. Select from the list of existing suffixes, or click to select a variable or build a new suffix using the expression editor.
- Password—Enter a password if you want to password protect the zip file.
- Hide password—Select this option to mask password during input.
-
Encryption—Select whether to create a zip file without encryption (Standard) or to encrypt the zip file.
Note: If you encrypt the zip file, you must have a zip utility that can support 128-bit or 256-bit decryption.
- Zip all files in this directory—Select a directory. All files in the directory will be added to the zip file. You can use both this field and the Source files field to select files to add to the zip file.
- Source files—Click Add Files to select one or more files to add to the zip file. In the File Collection Editor, do one or both of the following:
To add files created previously in the script, select a file in the left pane and click Add. Note: When a file name is displayed for selection in the left pane, any variable names that are used in the file name are visible (#MyVariable#), but suffixes are not visible. To select other existing files, click to browse to and select the files. In this field, you can also use the asterisk (*) and question mark (?) wildcard characters, as well as variables, in the file name to help you select one or more files (in the same directory) to add. To use this method: - Specify the file directory by browsing to and selecting one of the files.
- Then modify the file name in the Files to Archive pane using wildcard characters and/or variables.
Unzip Tab
- Archive name—Select a zip file.
- Password—If password-protected, enter the password.
- Extract to folder—Select a location to extract the files to.
To learn how to use the Zip/Unzip Files activity, see the following:
|
Find and Replace |
This activity opens one or more files and performs find and replace actions inside the files. You can write the results to a different location and file name.
Review the following for additional information:
- Find/Replace—You can have multiple Find/Replace tasks within one activity. You can specify a different source file, save file, and action for each Find/Replace task.
-
Source file—Select the file in which to perform the find and replace action for the selected Find/Replace task.
In this field, you can also use the asterisk (*) and question mark (?) wildcard characters in the file name to help you select one or more files (in the same directory). To use this method:
- Specify the file directory by browsing to and selecting one of the files.
- Then modify the file name in the Source file field using the wildcard characters.
- Find—Enter the content to find.
- Replace with—Select the type of replacement content: a value, contents from a file, or a variable value.
-
Set value—Enter the replacement value, select the replacement variable, or select a file containing replacement content.
-
Save file—Select a location and file name.
The source file is selected by default.
-
Suffix—Select a suffix to append to the file name. Select from the list of existing suffixes, or click to select a variable or build a new suffix using the expression editor.
Note: Use drag and drop or up/down arrows to change the order of multiple Find/Replace tasks in one activity.
To learn how to use the Find and Replace activity, see the following:
|
FTP File
|
Upload or download one or more files using an FTP or SFTP connection. Review the following for additional information:
To learn how to use the FTP activity, see the following:
|
Notes:
- To disable an activity, right-click the activity in the design window and select Disabled. This is helpful if you want to disable an activity while testing other activities.
- The Stop on Error option for each activity allows you to select whether to stop or continue execution if Toad encounters an error during that activity.
- Select the Log tab to review a script's execution log.
- In the Suffix field, the drop-down list includes two predefined suffixes (Date and DateTime). The list also includes any suffixes you have created and saved since installing Toad. To delete a suffix from the list, select the suffix, click , delete the suffix in the Expression field, and click OK.
- Automation does not support positional parameters denoted by a question mark.
|