Rreddy
(Rreddy)
January 10, 2024, 7:42pm
1
Hi all,
Can anyone help how can we transpose excel rows data into single row.
I have tried some but nothing helped. Seeking help from community
Input datatable:
Ram 25 never
Raj 20 yes
Hari 28 done
Output :
Ram 25 never Raj 20 yes Hari 28 done
Output should come in single row.
As I’m a new member unable to add my excel file here.
mkankatala
(Mahesh Kankatala)
January 10, 2024, 7:44pm
2
Hi @Rreddy
Welcome to UiPath Community!!
Check the below video it will help you to transpose the data in datatable.
Hope it helps!!
Rreddy
(Rreddy)
January 10, 2024, 7:47pm
3
Hi @mkankatala this is not my exact requirement. I want all my rows in single row but he is writing in 2 rows. Let me try once those by modifying that video code.
rikulsilva
(Henrique Lima da Silva)
January 10, 2024, 11:48pm
4
Hi @Rreddy
If you want a string with the result, you can try this
str_variable = String.Join(" ", yourDataTableVariable.AsEnumerable().Select(Function(row) String.Join(" ", row.ItemArray.Select(Function(column) column.ToString()))))
If you want as a single row check out the sample attached
Single Row.zip (14.2 KB)
Rreddy
(Rreddy)
January 11, 2024, 4:27am
5
Hi @rikulsilva this is writing everything in single column it’s should not happen like that.
Output :
mkankatala
(Mahesh Kankatala)
January 11, 2024, 4:29am
6
Provide your required output in a Screenshot @Rreddy
Rreddy
(Rreddy)
January 11, 2024, 4:30am
7
@mkankatala replied in above message. I’m not able to tag files more here it’s not allowing me.
rikulsilva
(Henrique Lima da Silva)
January 11, 2024, 4:34am
8
@Rreddy
Try this one. You can set the column separator as same join string separator
Single Row (2).zip (14.3 KB)
1 Like
Rreddy
(Rreddy)
January 11, 2024, 4:42am
9
Thanks @rikulsilva it’s working
1 Like
system
(system)
Closed
January 14, 2024, 4:42am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.