Search for column value and merge data cells


#1

I have two excel sheets where one has duplicate ids with 1 more column and the other has only unique ids with 1 extra column. I want to merge them by searching for those unique ids from the second datatable in the first datatable. I have uploaded a sample file for better understanding.merge.xlsx (9.8 KB)


#2

@Dominic @ovi @arivu96


#3

Hi @jamnanin

Refer this post.
DataTable

Regards,
Arivu


#4

Does anyone know how do i select rows from one table that are not available in the other table.


#5

@jamnanin

let us take you want to get the rows from dt1 which are not there in dt2

(From p in dt1.Select()
where (From q in dt2.Select() where string.Join(",",q.ItemArray).Equals(string.Join(",",p.ItemArray)) Select q).ToArray.Count<1
Select p).ToArray.CopyToDataTable()

Regards,
Mahesh