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
RL Settings > Untick “restrict blocks to CWD”
@Ruri In My Text File
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
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
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
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.
Thank you Sir alot.