I have duplicate records/rows in my excel and I wanted to know or have an “identifier” for all the records that are duplicate. What I was thinking was to perform each row check but I don’t know how to code it and I don’t know if that’s the best approach. Anyone can share light on this please? Please see below for more information. Thanks
Raw data (Filter: IF First Name, Last Name, Company, and Location have the same values)
ID
First Name
Last Name
Age
Company
Location
1
James
Fernandez
20
Company A
US
2
James
Fernandez
20
Company A
US
3
James
Fernandez
21
Company B
US
4
Toshiro
Shibuya
21
Company A
Asia
5
Escanor
Lion
22
Company A
UK
“Expected” output
ID
First Name
Last Name
Age
Company
Location
Comment
1
James
Fernandez
20
Company A
US
Duplicate records
2
James
Fernandez
20
Company A
US
Duplicate records
3
James
Fernandez
21
Company B
US
Single record
4
Toshiro
Shibuya
21
Company A
Asia
Single record
5
Escanor
Lion
22
Company A
UK
Single record
As you can see, I added new column so that when I use read range after doing this, the Bot will know if the records have duplicate and will be treated sa duplicate or not because the process will be different if the records have duplicate records or not.
Hi @Callos_James_AU u can use read range which will give u datatable.Add Data column Comment.Then use for each row and store each row’s value in variable and use that variable to compare in if conditons with second row if complete row matches then u can assign row(“Comment”)=Duplicate records.After the loop use write Range.
Thanks for these! However, I cannot apply it in code. If you’re free, would you be able to provide sample in codes? Thanks and sorry for bothering you on Sunday.
Clone creates a new DataTable with the same structure as the original DataTable.
By cloning we can compare rows and will update the column accordingly.
Hello @hasib08 How are you? I need to modify the output of the bot but I cannot get the expected output. I need to put identifier/classifier for all the duplicate columns, for example…
ID
First Name
Last Name
Age
Company
Location
Comment
1
James
Fernandez
20
Company A
US
Duplicate Entry 1
2
James
Fernandez
21
Company A
US
Duplicate Entry 1
3
James
Fernandez
20
Company b
US
Duplicate Entry 2
4
James
Fernandez
21
Company b
US
Duplicate Entry 2
5
Escanor
Lion
22
Company A
UK
Singe Record
I tried putting counter but it is giving me this output Appreciate your help again!