Example of using Rename action
- Updated: 2023/12/13
Example of using Rename action
In this example, you will build a bot to rename an existing file in a specified location. Use Regex expression to locate the specific file and rename it.
Prerequisites
Before you start building the bot, create the following files and name them:
- Automation360.txt
- Automation360_Old.txt
- Automation360-New.txt
- Datatable_new.csv
Procedure
- Create a bot.
- On the left panel, click Automation.
A list of available bots and forms is displayed.
- Click Create a bot.
- Enter the bot name: File_Rename.
- Click Create and Edit.
- On the left panel, click Automation.
- Rename the Automation360-New.txt file.
- From the Folder path field, enter C:\Temp\ option, in the
- In the File name field, select Type as Pattern.
- In the Value field, enter ([A-Za-z0-9]*)-\w+(.txt|.csv) to search for the file.
- In the New file name field, enter Automation360-latest.txt
- Select the Date option.
- From the Date option, select .
- In the Date field, enter
11/03/2023.Note: Enter the date on which you created the file.
- Click Save and then Run.
The bot renames the Automation360-New.txt file to Automation360-latest.txt.