| Solution |
| 1. | Create new task |
Click on Tools->Task Editor. |
| 2. | Go through all the files |
Insert Loop command to loop through each file in a folder command. |
| 3. | Create the folders based on the extensions |
- Insert IF command by selecting it from Conditions / Loops category.
- Select 'Folder does not exist' condition
- Specify the variables $CurrentDirectory$\$Extension$FileCollection
Screenshot 1 |
| 4. | Move the files to the respective folder |
Copy files command will copy current file in loop to the folder of
its respective type. For example if file name is C:\AutomationAnywhere.txt
then it will copy the file to txtFilecollection folder created in above step. Screenshot 2 |
| 5 | Delete the copied files |
Insert a Delete File command to delete the files to avoid duplicate copies. Screenshot 3 |
| |
| When you run this task, it loops through each file in a folder and will
create folders for each of the different extension types and moves the files within the respective folders. |