Ping_Pong
(Ping_Pong)
1
Hi there,
I am new to Uipath, I have a query that how to pass a text file data inside the loop
Example :
Q1 2022
Q4 2021
Q3 2021
Q2 2021
Q1 2021
Q4 2020
I am using the while loop but I am getting Q1 2022 for each time.
So how can I achieve this.?
Thanks in adavnce
Hey @Ping_Pong , So you are reading this data from text file?
You need to store this data in the collection lets say array or list, then only you can iterate through each of them.
lakshman
(Ganta lakshman)
3
@Ping_Pong
-
Let’s say you saved Read Text File output in outtext variable and it should be of type String.
-
And then use below expression in Assign activity.
In Left-hand, ArrOutText
In Right-hand, outtext.Split(Environment.NewLine.ToCharArray)
Note: Here, ArrOutText variable is of type Array of String.
-
And then use For Each Loop activity and pass ArrOutText variable to it.
For Each item in ArrOutText
Use Message Box activity and print item.
Ping_Pong
(Ping_Pong)
5
Hi @lakshman
Thank you sir, its working fine but I am getting empty messages in between quarter data, how can I achieve the item after another item without blanks.
lakshman
(Ganta lakshman)
6
@Ping_Pong
In Assign activity, make right hand side expression as below and then check it once.
outtext.Split(Environment.NewLine.ToCharArray,StringSplitOptions.RemoveEmptyEntries)
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.