Objective
The objective of this practice problem is for the user to demonstrate an understanding of the Text File commands discussed in the previous section by creating an automation that utilizes said commands. The commands covered in the previous section were the Read Text File and Write Text File commands. In the future, these commands may be implemented into other practice problems.
Scenario
An employee of the ABC company access a text file document from the company database containing important classified information about a project.
Prerequisites
The only prerequisite for this practice exercise is for the user to create a blank text file (.txt) that has already been saved.
Practice Problem Requirements
The user must create an automation that performs the following tasks:
  • Open and write a message (i.e. Hello!) to a text file (Practice_Text.txt)
  • Read the message and save it to a variable
  • Display the saved message in a message window

Problem Difficulty: Very Easy
Solution will be provided on the next page with a brief explanation.

Solution
The code for the solution has been provided below.

As a quick summary:

Step 1: The Write Text File Command will be used to write the message to a pre-existing text file

Step 2: The Read Text File Command will be used to read the message and save it to a variable

Step 3: The Show Message Command will show the message in a Message window in OpenBots Studio.

Helpful tip: Use variables to save the information for the text file path and message

Newsletter Bot

Lets stay in touch!

Join our weekly newsletter and follow us on social media.

Contact Sales
Call Our Experts!