We use text files a lot during our daily work, So does the RPA.
Let’s see how to read and write to Text file!!!
Implementation using UiPath :
Let us implement a workflow to write the data to a text file, then read data from it and then again append some text to it.
Different Text file Operations:
1. Writing data to a text file
2. Reading data from a text file
3. Appending data to a existing text file
Drag “Input Dialog” activity into the designer panel and create a variable to store the user-provided value.
Drag “Write Text File” activity to write the data provided by the user to a text file.
(If the supplied .txt file is not available in the directory, the activity will create a new file with that name)
Drag “Read Text File” activity to read the data from the provided text file.
Drag “Message Box” activity to display the text obtained from the above step.
Drag “Append Line” activity into the designer panel to append the text to an existing text file and pass the inputs .i.e data that is to be appended and text file’s path.
(When we use “Append Line” activity, it will not overwrite the text file data but
instead, it will write the new data from next new line unlike “Write Text File”)
Finally, execute the workflow and observe the output carefully 🙂
Click here to download the Source Code…
Hope it has helped you…