How to put the contents of second column below the first column

Hi all,

Is there any way by which we can copy and put contents of the second column below the first column.

Like:
Column1 : Column2

ABC : FGH
DEF : HJT
GFT : UIO
ZCV : LKJ

Here I need to put all the value from the second column below the Column 1.

Like:

Column1

ABC :
DEF :
GFT :
ZCV :
FGH
HJT
UIO
LKJ

The issue is that last range in column one will change every time. If anyone knows please let me know.

Thank you.

Hi @vishnu_prasad21

Use strinput=Row(“Column1”). ToString.split("". ToCharArray)

Thanks
Ashwin.S

1 Like

@vishnu_prasad21
Lets assume ABC : FGH is a string value in a column in a row

with the named split function you can create two string lists, 1 for each column and later you can merge/combine the two lists. In case of you need more help just provide a sample Excel file for us and we can work out a demo xaml.

1 Like

C2belowC1.xlsx (8.9 KB)

Thank you for the idea i have uploaded a sample file for your help.

Please let me konw the code so that I can do it in my project.

FYI: the list of items in column 1 & 2 changes every-time.

@vishnu_prasad21
great give me some time I will have a look on it after my lunch

@vishnu_prasad21
Fortunately the situation were easier as the Excel had 2 columns and there were no need to use the split method.
In my demo XAML I balanced for you the classical style with different UiPath Activities and some LINQ statement

Kindly note this is one implementation of many other options and can be adjusted as well.

First Part: Creating Value Lists
grafik
From each column a string list were retrieved

Second Part: Appending one list to the other
grafik
Showcasing the mode Col2 after Col1 Or Col1 after Col2 Appending with an if statement
Condition Boolvariable can be later caluclated eg on some triggers (in your case isCar, isMotoCycle)

Third Part: Creating a Result Datatable
grafik
Classical done with for each and add data row

So we get a datatable ready to write back e.g. to an excel file

Standalone demoy XAML: vishnu_prasad21.xaml (12.7 KB)

Let us know your feedback and flag the solving post as solution, so other forum members can benefit from it

1 Like

Thank you for the solution it worked fine. I was able to implement it on my project.

:smiley:

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