marquezd
(Marquezd)
1
Hi everyone,
I want to convert a dt into a string format, the dt value is like:
[Column0
5 star
65%
4 star
17%
3 star
8%
2 star
3%
1 star
7%
]
Where I only got one column and one row, and I want to convert into this:
[5 - 65%]
[4 - 17%]
[3 - 8%]
[2 - 3%]
[1 - 7%]
How can I do that ??
Parvathy
(PS Parvathy)
2
Hi @marquezd
=>
Output → dt
=> Use the below LINQ expression:
finalString = String.Join(Environment.NewLine, dt.AsEnumerable().Where(Function(row, index) index Mod 2 = 0).Select(Function(row, index) "["+row(0).ToString().Split(" "c)(0) + " - "+ dt.Rows(index * 2+1)(0).ToString+"]").ToList())
Hope it helps!!
1 Like
marquezd
(Marquezd)
3
It doesn’t work, because the only row contains all the information like this:

I put in an excel file beacuse UiPath does not allow me, but the information is all in row 0 in this case, any suggestions ??
Parvathy
(PS Parvathy)
4
Hi @marquezd
Is it throwing any error. As i have replicated the same data in Build Data Table as provided and the query works at my end.
Regards
marquezd
(Marquezd)
5
Yes, it thows the error that there not value at position 1.
Parvathy
(PS Parvathy)
6
Hi @marquezd
Can you share the excel file you are using
Regards
marquezd
(Marquezd)
7
example.xlsx (9.6 KB)
Sure, thats the excel File.
Parvathy
(PS Parvathy)
8
Hi @marquezd
Check the below workflow file
Sequence4.xaml (10.3 KB)
Hope it helps!!
marquezd
(Marquezd)
9
Thanks a lot, it works but I hace to instaal some features to run
1 Like
system
(system)
Closed
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.