Merge Data Table different Column Names

Hello I have 2 data Tables as below:

Data Table 1 :
image

Data Table 2 :
image

Output:
image

in the both the data table few columns are same but in the one column name is different characters so in that cell constant word is Name i need to merge that column into where column name contains Name in that location any one can help

Thanks in advance

Regards
Shriharsha

@Palaniyappan @lakshman @balupad14

Hi @Shriharsha_H_N,

  1. Read both datatable DT1 and DT2 and assign to Input Datatable 1 and 2
  2. Create a DatableT for FinalDT and assign it to Output DataTable

You can use a Join data Table Activity

image

Column Table1 wil be : NAME ABCDEF GHI
ColumnTable 2 will be : Name BCD LMN
Operation will be : =
Join : Try with Full


Mukesh

hello @mukeshkala
in this 2nd columnname not an constant only Name is the constant word

Column Table 1 - The name of the column in the first table. This field supports only String variables containing the column name, Int32 variables containing the column index or ExcelColumn variables.

Please refer the link

@Shriharsha_H_N
Changing columnname
datatablevar.columns("columnnameorindex).columnname =“newname”

Changing column position
datatablevar.columns("columnnameorindex).SetOrdinal

With this two Methode you can bring in a dynamic way the Second Datatable structure similar to the First and can easy merge it

1 Like