Hi
I have 5 lines in notepad file [file.txt]:
eg.
Resources
Video
Documents
Help
ContactUs
I want to fetch the line’s text one by one, and save it in variable.
I am using:
Select file Activity to select the file at run time [file.txt].
Then Assign Activity and assigning variable of String type = File.ReadAllText(selectedFile).
opList = File.ReadAllText(selectedFile)
Then used For each loop
But no luck
Attached the file2nd-copy.xaml (8.1 KB)
1 Like
arivu96
(Arivazhagan A)
February 6, 2018, 10:45am
2
HI @shruti.o.gupta ,
you can use Read Text File Activity, it will return the String value.
after getting the value using split Environment.NewLine option spit the value to array
For loop through the array value you can get the each value .
arrvalue= strvalue.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)
Regards,
Arivu
1 Like
Dominic
(Dominic)
February 6, 2018, 10:46am
3
@shruti.o.gupta , In For each use this item in opList.Split(CChar(Environment.Newline)) and change the type argument to string.
Inside body of for each remove everything and use write line and include item
Regards,
Dominic
1 Like
sarthakj
(sarthak jain)
February 6, 2018, 11:08am
4
Hi @shruti.o.gupta ,
Please find updated workflow, I hope this is what you wanted.
Reg,
Sarthak
2nd-copy.xaml (6.8 KB)
1 Like
bbarik
(binamra barik)
July 21, 2018, 6:07pm
7
buddy after splitting how you stored each line of notepad to new string
1 Like