Do you want to Get Duplicate values from a Column and place them in another Excel Sheet and also update the Comment column for those rows which are duplicates ?
Could you also provide us with the Expected Output for the Input data provided ?
Edit#2: Attaching aswell the results from finding duplicates using Excel’s functionality: Same results (24 results in excel, since there are 2 of each)
Use Assign activity DtOutput | Variable type | DataTable
DtOutput = (From p in DT.Select() where( From q in DT.Select() where q("Fatura No").Equals(p("Fatura No")) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()
Use Write Range activity and pass the DataTable as DtOutput
To keep it simple, since LINQ would not add a huge amount of improvement, as it did with the 1st one, you could simply iterate through the result (Array of Strings) and use the activity to “Add Data Row”:
1- Create sample DataTable either by using originaldt.Clone, or Build Datatable, as you prefer
2- For Each string in Resulting Array
3- Add Data Row with the current string
4- ReWrite to excel the resulting DT