Merge rows from 2 excel files but different column names


#1

I have an excel sheet with a set of column names and multiple excel sheets with same values but different column names. for eg.( Name, Full Name,etc). how do i append the column from all these files to the first file in a for each loop?


#2

@jamnanin

Do the Indexes of the Columns remains Same for all Excel sheets( Eg: index of column “Name” in 1st sheet is 0, then is the index of column “full name” in the other sheet also remains as 0.

Regards,
Mahesh


#3

@jamnanin

If the format of all the sheets is same and the indexes of the columns remains same then you can use Merge DataTable.

Regards,
Mahesh


#4

Its not and i have to append a list of excels to the 1 original excel


#5

@MAHESH1 when i assign column names to a data table with or it gives me the following error


where testRow1 is the original file and i am assiging it to a diff datatable value.


#6

@arivu96, @vvaidya Any idea on how to do this?


#7

@jamnanin

You should give only column names which are there in that dataTable. You should not use any Conditions like (or , and)

Regards,
Mahesh