Transpose multiple rows into single column

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.

Hi @Rreddy

Welcome to UiPath Community!!

Check the below video it will help you to transpose the data in datatable.

Hope it helps!!

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.

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 (14.2 KB)

Hi @rikulsilva this is writing everything in single column it’s should not happen like that.

Output :

Provide your required output in a Screenshot @Rreddy

@mkankatala replied in above message. I’m not able to tag files more here it’s not allowing me.


Try this one. You can set the column separator as same join string separator

Single Row (2).zip (14.3 KB)

1 Like

Thanks @rikulsilva it’s working

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.