File Operations Using UiPath

As we know that Computers are used for storing the information for a Permanent Time, or the Files are used for storing the Data of the users for a Long time Period.

The files can contain any type of information that means files can Store the text, any Images or Pictures, or any data in any Format. So that there must be some mechanism those are used for Storing the information, Accessing the information, and also Performing Some Operations on the files.

Many files have their type and own names. When we Store a File in the System, then we must have to specify the Name and the Type of File. The Name of the File will be any valid Name, and Type means the application with the File has linked.

We can say that every File also has some type means every File belongs to Special Type of Application software.

When we Provide a name to a File, then we also specify the Extension of the File because a System will retrieve the Contents of the File into that Application Software. For Example, if there is a File Which Contains Some Paintings, then this will Be Opened in the Paint Software.

The Following are the different types of File :

  • Ordinary files or simple files: Ordinary Files are used for storing information about the user Programs. With the help of Ordinary Files, we can store the information which contains text, database, any image, or any other type of information. Ordinary File may belong to any kind of Application, for example, notepad, paint, C Program, Songs, etc. So all the files that are created by a user are Ordinary Files.
  • Directory Files : The Files that are Stored into a Particular Directory or Folder are called Directory Files. Because it belongs to a Directory and they are Stored into a Directory or Folder. For Example, a Folder Name Songs, which Contains Many Songs So that all the Files of Songs are known as Directory Files.
  • Special Files : The Special Files are those who are not created by the user or the files which are necessary to run a System. These files are created by the system that means all the Files of an Operating System or Window are referred to as Special Files. There are Many Types of Special Files, System Files, or windows Files, Input-output Files. All the System Files are Stored into the System by using. Sys Extension.
  • Fifo Files : The System uses the First in First Out Files for Executing the Processes into Some Order. Means To Say the Files those are Come first, will be Executed First, and the System Maintains an Order or Sequence Order.

Files are not made for just reading the Contents, and we can also Perform Some other operations on the Files those are Explained below As

  • Read Operation : Meant To Read the information which is Stored into the Files.
  • Write Operation : For inserting some new Contents into a File.
  • Rename or Change the Name of File.
  • Copy the File from one Location to another.
  • Sorting or Arrange the Contents of File.
  • Move or Cut the File from One Place to Another.
  • Delete a File
  • Execute Means to Run Means File Display Output

Keyboard Shortcuts in UiPath Studio

Creating New Folder with UiPath

Create a new Process called File_Operation_Example

file-operations-example-process-rpa-uipath

We are going to create a folder, add Create Folder activity inside the sequence, and enter the Name of the folder you want to create.
creating-new-folder-cinema-rpa-uipath

Now, save and run the sequence. After the execution, the Cinema Folder has been Created in the File_Opetrations_Example.
cinema-folder-rpa-uipath

Creating a New file inside the Folder with UiPath

Next, I am going to create a new TXT file inside the Cinema folder. Add Create File activity inside the sequence and then click on the Create File Activity and enter the Name of the File (New_File.txt) in the Properties pane for File and enter the path as in the double quotes, as shown below.
enter-file-name-rpa-uipath

Now, save and run the sequence, After the execution, the New_File.text file has been created.
new-txt-file-rpa-uipath

Delete File and Folder with UiPath

By using the Delete activity, Ia m going to delete the New_File.txt file.

Add the Delete activity inside the sequence and then enter the path of the New_File.txt in the Properties pane for path property.
add-delete-activity-rpa-uipath
complete-path-to-delete-file-rpa-uipath

Now, save and run the sequence, after the execution, the File and folder both will be deleted in the given folder.
deleted-file-and-folder-rpa-uipath

Copy File with UiPath

Create a sequence called Copy_File_Operation

new-sequence-copy-file-operation-rpa-uipath

Add Copy File activity inside the sequence and fill the required fields
enter-from-and-destination-file-rpa-uipath

Save and run the sequence, and After the execution, you will find the same File has been copied in the Destination-file.
copied-file-rpa-uipath

In the same way, you can create a copy of any kind of File.

Move File with UiPath

The Move file activity is used to move the File from one Folder/Directory to another Folder/Directory

Comment out the Copy File activity inside the sequence and then add Move File activity inside the sequence and enter the required fields, such as From which Folder you are going to move the File and To which folder you are Moving the File.
move-file-activity-rpa-uipath

Now, save and run the sequence, After the execution, the New_file.txt file has been moved inside the New folder.
moved-file-rpa-uipath