How to merge 2 different excel into one sheet

Hi Team,

I want to merge 2 different column sheet into single sheet

say fr ex: ID, Code, Mid, Address, AGe
ID, Code, Phone, Address

Hi @bhanu.priya2

You can use the Join datatable activity to join the two datatables into one, but one column has to same in both datatables.

Follow the below steps,
→ Use the Read range workbook activity to read the excel1 and store in a datatable variable called dt1.
→ Use another read range workbook activity to read excel2 and store in dt2.
→ Then use the join datatable activity give the dt1 and dt2 select the inner join and give the column name as ID.
→ Create output variable in the output of Join datatable activity.
→ Then use the output datatable variable in write range workbook activity to write the joined data in excel.

Hope it helps!!

It is not merging the file instead it is duplicated the columns like below

ID, Code, Mid, Address, Age, ID, Code, Phone, Address and there is no value added only headers are there

Only if ID matches it will join. If you want to join even if not matched then use FULL JOIN. Yes while joining all columns headers will come from both the sheet. After join you have to use Remove data column to remove unwanted column using the header name

it is still not joining the way i want, i need to append the data including headers

@bhanu.priya2

Use Build Datatable activity:Add columns as ID, Code, Mid, Address, AGe,Phone–>outPutDT

Use Read Range activity to read two datatables–>DT1,DT2
Use Merge Datatable activity:Source:DT1
Destination:outPutDT
Use Merge Datatable activity:Source:DT2
Destination:outPutDT

Use write Range Workbook–>outPutDT
Hope this works for you

  1. Read DT1
  2. Read DT2
  3. Use Build DT and provide all the column headers
  4. Use Write Range and write the headers alone. Give output file name, sheet name and Data table as Build DT variable name.
  5. Use Append Range activity and give DT1 in data table name and provide same output file name and sheet name. In Range give based on the requirement
  6. Again use Append Range to write DT2 in the same file. Provide Range according to requirements

Okay @bhanu.priya2

You want to merge the excel1 with excel2 but you want to keep the excel1 headers.

If my understanding is correct, then check the below steps,
→ Use the Read range workbook activity to read the excel1 and store in a datatable variable called dt1.
→ Use another read range workbook activity to read excel2 and store in dt2.
→ Then use the Merge datatable activity give the dt1 and dt2.
→ Create output variable in the output of Merge datatable activity.
→ Then use the output datatable variable in write range workbook activity to write the joined data in excel.

Instead of using join datatable activity use the Merge datatable activity.

Hope it helps!!

You can follow the above approach or you can use the below steps,

→ We have two excels right, let’s imagine it as Excel1 and Excel2.
→ Use the Read range workbook activity to read the Excel2 and store in a datatable called dt.
→ Then use the Append Range workbook activity give the Excel1 file path and give the Excel1 Sheet name, give the dt in the datatable field.

Excel2 data will merge to the Excel1 data.

Check the below workflow for better understanding,

Hope it helps!!