Read File Text
This node retrieves data from a text file with a .txt
extension.
File Path
Enter the path of the file to be read.
Mode
Read a line
Read a single line of data from the file.
- Random: Reads data from a random line.
- Delete After Read: After reading the data from a line, that line will be deleted from the data list.
Read All Lines
Read all data from the file.
Delimiter Character
Specify the character used to separate data within a line.
Assign to Variable
Assign the value to a variable.
Practical Example
You have a text file containing a list of image links as follows:
The workflow randomly opens an image link and then deletes it from the file.
First, you use the Read File Text
node to retrieve data from the file. You configure the Mode
to Read One Line
, select Random
, and enable Delete Line After Reading
to fetch a random line and remove it. Since each link has no delimiter character, you can leave the Delimiter Character
field blank. To store the retrieved value, you assign it to a variable named link
.
Next, you configure the Open URL
node to open the link stored in the link
variable.
Then, you use a Repeat Task
node to run the process again.
The node cluster looks like this:
When running the node cluster, the script retrieves and opens 2 random links, then deletes those links from the file: