Objective

The objective of this practice problem is for the user to demonstrate an understanding of the File and Folder commands discussed in the previous section by creating an automation that utilizes said commands. The commands covered in the previous section were Extract files, Move/Copy files, Move/Copy folders, Delete file, Delete folder, Rename folder, Rename file, Create Folder commands. In the future, these commands may be implemented into other practice problems.

Scenario
The HR coordinator at ABC organization must extract a compressed file on to the system and copy the extracted project data into a separate folder along with renaming the folder and delete the original one. The coordinator is directed to perform the function by the head of engineering.
Prerequisites
The user must have a sample compressed folder (.zip can be easily made in the system) with OpenBots supported file format. Feel free to delete the zip file when finished with the exercise, although this will mean that the automation cannot be run again.
Practice Problem Requirements

The user must create an automation that performs the following tasks:

  • Create a new folder to extract the compressed file (User can decide name of the folder)
  • Extract the files into the newly created folder
  • Copy the extracted folder and move it into a new folder (User can create a new folder while performing the copy function)
  • Rename the newly created folder (User must use appropriate naming convention)
  • Delete the original extracted folder

Problem Difficulty: Medium
Solution will be provided below with a brief explanation.

Solution
The code for the solution has been provided below.
As a quick summary:

Step 1: Create a new folder to extract the compressed zip file. Select the location of the new folder.

Step 2: Extract the compressed zip files to the newly created folder.

Step 3: Copy the extracted folder inside the new folder created at the beginning and paste it into another newly created folder using the same move/copy command. Copy command gives an option to create a new folder while moving or copying.

Step 4: Rename the newly created folder to something more appropriate like ProjectFolder etc. Use proper naming conventions.

Step 5: Delete the original folder created for extracting the zip file as it is no longer needed.

Newsletter Bot

Lets stay in touch!

Join our weekly newsletter and follow us on social media.

Contact Sales
Call Our Experts!