We have to read the excel file which contains duplicate names, here we have to select the name and count of that name and prepare a new excel sheet with two columns i.e name and count and get respective values

We have to remove duplicates without repetitive looping . and get name and count seperately in different columns. Please help its urgent.

Thanks and Regards,
sandeep.

@sandeepbht96

Same issue as before I take it?

You will need a for each regardless to identify the duplicates for counting them.

But this is a simplified version using the following code to remove duplicates:

((From LineNo In dt.DefaultView.ToTable(True,“Name”).Select().ToList() Select (From row In dt.Select Where row(“Name”).ToString=LineNo(“Name”).ToString Select row).ToList(0)).ToList()).CopyToDatatable()

RemoveDuplicatesCode.xaml (15.9 KB)

Employees.xlsx (8.6 KB)

image

Emp_DT.Select(“Name=’”+name_element+"’")