![]() |
| |||||||
Automation Anywhere Post messages and questions related to Automation Software here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
|
I know this must be easy do do, but how do you get it to copy files that were created yesterday and yesterday only? I would like to put a variable in the between fields but it wants valid dates only.
Last edited by DavidPantoja; 01-23-2008 at 10:57 AM. |
| |||
|
Hello David, Using Automation Anywhere 4.0, you can copy files created yesterday. There are two ways to accomplish this task; you can use any one of them that suits your requirement best. First way is, select 'Copy Files' option of Files/Folder command, specify 'Source Files' and 'Destination Folder' as per your requirement, click on 'Advanced View' button, from 'Select Date' drop down choose 'Create Date', select option 'in last' and in 'Days' textbox specify 1. The text format of command would appear something like this: Copy Files "C:\Temp\*.*" to "C:\YesterdazFiles" if file is created in last 1 days Second way is, use 'Loop for each file in a folder' option of Loop command, inside loop insert condition, 'If Date' i.e. if create date of file is in last one day then copy that file using 'Copy File' command (see attached screenshot). About Loop For Each file in a folder command: If you want to perform some actions for all files in a folder, use this command. Often number of files in a folder can change. You can specify a folder and this loop will run for as many times as there are number of files in that folder. You can get the name of the file by using the System Variable $FileName$. Similarly to get the extension of the file you can use $Extension$ System variable and to get the path of the folder under which this file resides use the System Variable $CurrentDirectory$. All these system variables will return empty value when used out side this looping command. Following is the text format of task, 1) Start Loop " Each File in C:\Temp" 2) If File date ("$CurrentDirectory$\$FileName$.$Extension$" created date is in last 1 days) Then 3) Copy Files "$CurrentDirectory$\$FileName$.$Extension$" to "C:\YesterdazFiles\" 4) End If 5) End Loop We have created task (CopyFilesCreatedinLast1day.atmn) for your convenience. Copy it under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder. Before running this task, edit this task to change source folder in 'Loop for each file in a folder' command (Line No. 1) and 'Destination Folder' in 'Copy File' command (Line No. 3) as per your requirement. Hope that helps. |
| |||
|
The problem with both of those solutions is that it also copies yesterday and todays files. I can try copying both days to a folder with the last 1 day parameter, then delete todays files with the last 0 day parameter from the copied files. But what is really needed is the ability to use variables in the date fields.
|
![]() |
| Thread Tools | |
| Display Modes | |
| |