---
title: "Examples of use - File system"
url: "https://docs.robotiq.ai/en/article/examples-of-use-file-system"
language: "en"
last_updated: "2025-03-12T10:38:25.672Z"
---

# Examples of use - File system

This is an example that shows how to use the following steps:

-   [**Get Folders in Folder Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/get-folders-in-folder-step)
-   [**Get Files in Folder Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/get-files-in-folder-step)
-   [**Get File Extension Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/get-file-extension-step)
-   [**File Exists Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/file-exists-step)
-   [**Move Copy File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/move-copy-file-step)
-   [**Empty Folder Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/empty-folder-step)
-   [**Rename File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/rename-file-step)
-   [**File Exists Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/file-exists-step)
-   [**Delete File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/delete-file-step)
-   [**Read Text From File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/read-text-from-file-step)
-   [**Compress Folder To Zip File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/compress-folder-to-zip-file-step)
-   [**Extract Zip File Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/extract-zip-file-step)
-   [**Save Screenshot Step**](https://ynvpklnbkvswa87.productfruits.help/en/article/save-screenshot-step)

We create a string variable named FolderPath to store the folder path "C:\\RPA\\".

![](https://cdn-assets.productfruits.com/9bd4ce83-e079-42bf-8921-7d876f714468)

We have two folders in our directory named "Finish" and "Working".

![](https://cdn-assets.productfruits.com/ad764cd0-92b5-488a-85ee-c5e8f2a91615)

### Get Folders in Folder Step

Lets use "**Get Folders in Folder Step**" as input to retrieve folders using our FolderPath variable. 

![](https://cdn-assets.productfruits.com/49f8aa05-a1b5-4007-be01-7003a8b90ef3)

The ListOfStrings variable AllFolders contains two items in the list::

  
0\. Finish

  
1\. Working

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/0227896e-2534-4288-be6f-f5e2e584ac34)

Concatenate the folder path with the working folder to create the new variable FolderName with value "C:\\RPA\\Working". Check [examples of use- text steps](https://ynvpklnbkvswa87.productfruits.help/en/article/examples-of-use-text-steps) for more information.

### **Get Files in Folder Step**

Let's use the "**Get Files in Folder Step**" to retrieve the excel file in the Working folder.

![](https://cdn-assets.productfruits.com/dd6b38a6-7a20-4918-b76f-9814ecda1ecc)

If you don't know the exact name of the Excel file, you can search for any file with the extension .xlsx by using the search term \*.xlsx, where the asterisk represents any name. For instance, if you know that the name of your file includes the word "demo," you can search for \*demo\*.xlsx. Our ExcelFile will now be list of strings with only one element, containing the full path of the searched file.

### **Get Files In Folder Step**

To read the data from the list, we will use the "Read String From List" step.

![](https://cdn-assets.productfruits.com/bec09ae7-8c9e-4fb0-af0b-2b4931f94b9b)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/976eefb8-c341-487d-87ab-fb1ea20bbd9f)

### **Get Files In Folder Step**

To read the data from the list, we will use the "Read String From List" step.

![](https://cdn-assets.productfruits.com/4175b354-deb6-42d3-9e1e-4b15a96afcb6)

### **Get File Extension Step**

To get file extension, we use "**Get File Extension Step**".

![](https://cdn-assets.productfruits.com/754ca312-afef-4aba-8f1f-9f6080f496da)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/ddf38088-387b-4b4f-a795-7d62620a9795)

### **Empty Folder Step**

Now we will empty Finish folder using "**Empty Folder Step**".

![](https://cdn-assets.productfruits.com/b93c3188-90a4-4048-b695-b7d3145727a0)

### **Move Copy File Step**

Our Finish folder is empty now. Let's use the "**Move Copy File Step**" to **copy** the file to the Finish folder. Now, we have a copy of our Excel file in the Finished folder.

![](https://cdn-assets.productfruits.com/159553a7-2f50-4fb4-a617-678e61794009)

![](https://cdn-assets.productfruits.com/163058fd-5c06-40a0-8bce-194b1c3343b5)

### **Rename File Step**

Now we will rename our copied excel file to name "New excel name" in the "**Rename File Step**"

![](https://cdn-assets.productfruits.com/08117902-2270-4a64-b2c0-c263e5830b47)

After the execution of the process, the current situation in our "Finish" folder is as follows:

![](https://cdn-assets.productfruits.com/fbec3e84-b158-421e-b6b4-b42da0052691)

### **Delete File Step**

If you wish to delete a file, use the "**Delete file Step**". We will use this step to delete our Excel file.

![](https://cdn-assets.productfruits.com/a2d38000-1324-48ef-8783-fb84f36ee649)

### **File Exists Step**

We will now utilize the "**File Exists Step**" to verify the existence of a file. The result of this step will be saved in a boolean variable called FileExists. The boolean variable has a value of "False" because in the previous step, we deleted that file.

![](https://cdn-assets.productfruits.com/76687cb0-a706-4b0b-8d82-f931bc0e12cf)

### **Extract Zip File / Compress Folder To Zip File Steps**

Let's compress the Working folder, extract it and save both folders in "C:\\RPA".

![](https://cdn-assets.productfruits.com/f640f8e1-6f27-458f-86fe-5c72683e1b19)

![](https://cdn-assets.productfruits.com/bbf46c7a-3b20-458f-9831-ab90f64734de)

After the execution of the process:

![](https://cdn-assets.productfruits.com/15c2ddf7-4b27-46e6-aa42-56f59d642fc4)

### **Read Text From File Step**

Let's go to the Working folder and create a document called FileDocument.txt. In this file, we will write "Greetings to our new colleague Robotiq.ai".

![](https://cdn-assets.productfruits.com/2beb8eff-caa2-4830-991a-35ed3f1a69b0)

With "**Read Text From File Step**" we will read text in created file and store it in the new variable FileText.

![](https://cdn-assets.productfruits.com/3eb1825c-ab26-4596-86f7-8858b280efb0)

**Input and Output variables:**

![](https://cdn-assets.productfruits.com/29465abb-8019-4425-bd4c-249de0276acc)

### **Write Text To File Step**

To add new text to an existing file, you can use the "**Write Text to File Step**". 

![](https://cdn-assets.productfruits.com/0230ae2e-be96-4204-a614-96db1ceb6a97)

To see the text saved in the 'FileDocument.txt' file, we will take a screenshot.

### **Save Screenshot Step**

Now the robot will take a screenshot and save it as Schreenshot.png in the Working folder. 

If you run the robot multiple times, the picture will be overwritten.

![](https://cdn-assets.productfruits.com/ddc38308-9a3c-4f3a-8168-1cd86aba7259)

The full path to our screenshot picture is saved in the variable SavedScreenshot: "C:\\RPA\\Working\\Screenshot.png".

![](https://cdn-assets.productfruits.com/d25cac5a-e6f0-4d94-88da-21b63a779ee6)
