Merge two Datatables column wise

I had a Data in Two Excel sheets
Input data:
Excel1(sheet1): Column1 with the data (Ex : names(name1, name 2, name 3, etc…)
Excel1(sheet2) :Column 1 witht he data (Ex : ages(age1, age2, age3, etc…)

Output(Expecting) :
Excel1(Sheet3) : Column1 should be names and colum 2 should be Age…data need to be shown side by side …
can any one helpout…

Thanks,
Prasad

2 Likes

@Hanumaprasad_Chilaka In Excel Sheet 1 are there any other columns or only it contains Single Column?

Hi
—Create a datatable with two columns using build datatable activity And get the variable output named dt
—now read those two datatable with read range activity and get the datatable variable named dt1 and dt2
—then use FOR EACH ROW activity where pass the variable dt1 as input
—inside the loop use ADD DATAROW activity And mention this in ArrayRow property like this
{row(“yourcolumnname”).ToString,dt2.Rows(dt1.Rows.Indexof(row))(“yourcolumnname”).ToString}

And in datatable mention as dt

Now dt will have both data

This can be written back to excel with write range activity

Cheers @Hanumaprasad_Chilaka

2 Likes

@Hanumaprasad_Chilaka

Please find the workflow…

@Hanumaprasad_Chil_Solution.xaml (7.7 KB)

Excel1.xlsx (10.3 KB)

Regards,
@hacky

hi @Hanumaprasad_Chilaka

I was implemented the solution without using foreach row.In this process you can add multiple columns with different names it will take which column you want.you can check the solution in excel and sheet name is pradeep_solution
Please find the below files
Excel1.xlsx (10.8 KB) pradeep_Solution.xaml (6.4 KB)

1 Like

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