Input text file from My Computer

I Wanna Input Text File from My Computer to Text field of Type Block. How I Can do .
Ty My Friend

do you need to get a line of the file or the whole file?

Line of file.
Example in Content.txt

1
2
3

I Wanna get only 1 2 3

You need 2 blocks, one to read the file contents and another one to type them

I got this error


RL Settings > Untick “restrict blocks to CWD”

1 Like

@Ruri In My Text File :heart_eyes:
Line1: Abc
Line2: Def
Line3: Ghi

I wanna Get only Line1 In textfile to OB2 How I can do that.

Read all the lines to a variable called like lines and then use lines[0] to get the first one

I used it But seem not working

Can you also show me the other block you used to get the lines from file? Just to make sure it’s correct, thanks!

Here it is:

BLOCK:FileRead
path = “C:\Users\Tr\Desktop\Dan\Noid.txt”
=> VAR @Noid
ENDBLOCK

BLOCK:PuppeteerTypeElement
LABEL:Content
findBy = Selector
identifier = “textarea#txtDescription”
text = @lines[0]
ENDBLOCK

You output to a var called Noid but then you use it as lines…
Do you see your mistake? You need to use the same name on both
Also that block is wrong you need FileReadLines because you want to output a list not a single string

BLOCK:FileReadLines
path = “C:\Users\Tr\Desktop\Dan\Noid.txt”
=> VAR @Noid
ENDBLOCK

BLOCK:PuppeteerTypeElement
LABEL:Content
findBy = Selector
identifier = “textarea#txtDescription”
text = @Noid[0]
ENDBLOCK
1 Like

If I wanna get line 2 line 3 line 4 line 5 (Minus Line 1). How Code it is?

Otherwise just specify manually which one you want like Noid[1] for the 2nd element, Noid[2] for the 3rd etc.

I don’t know where you want to use those so I can’t help more than this

1 Like

Can I Remove From List with Var in “File Read” ?
Not File Read Line.

No, file read will read as a string. Read lines will read as a list of strings.

1 Like

Thank you Sir alot. :dancing_women: