uio
(uipath test)
March 21, 2024, 5:40am
1
Hi All,
I have to compare two Excel files MasterFile & InputFile to find duplicates in a column “Full Name”.
If a duplicate value found, add remark in the InputFile as “Duplicate found” and “Not a duplicate” in the remaining unique value rows.
Thank you,
Uio.
mkankatala
(Mahesh Kankatala)
March 21, 2024, 5:45am
2
Hi @uio
Could you share your input files, If it doesn’t have any confidential information.
uio
(uipath test)
March 21, 2024, 5:52am
3
No problem sharing it. Just random values.
InputFile.xlsx (9.2 KB)
MasterFile.xlsx (9.2 KB)
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:05am
4
Okay @uio
→ Use the Read range workbook activity to read the InputFile.xlsx and store the output in a DT1 variable.
→ Use another Read range workbook activity to read the MasterFile.xlsx and store the output in DT2 variable.
→ Use the assign activity and keep the below LINQ Expression,
- Assign -> DT_Output = DT1.AsEnumerable.Select(Function(r) DT1.Clone.LoadDataRow({r(0),r(1),r(2),if(DT2.AsEnumerable.Any(Function(r2) r("NAME").ToString=r2("NAME").ToString),"Duplicate found","Not a duplicate")},False)).CopyToDataTable()
→ Use the write range workbook activity to write the DT_Output in to InputFile.xlsx and to same sheet.
Check the below workflow for better understanding,
Check the below output file,
InputFile.xlsx (9.1 KB)
Hope it helps!!
uio
(uipath test)
March 21, 2024, 6:30am
6
Can you provide the project file please ?
1 Like
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:32am
7
Sure @uio
Check out the below workflow, change the path of the excel files in the activities.
Regex_Practice.xaml (19.9 KB)
If you find the solution for your query, Make my post Mark as solution to close the loop.
Happy Automation!!
uio
(uipath test)
March 21, 2024, 6:37am
8
How do I do it using Write cell activity ?
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:39am
9
write cell activity used to write the data in the single excel… @uio
Could you elaborate your query. what your need
uio
(uipath test)
March 21, 2024, 6:43am
10
I just need to lookup for duplicates and if a duplicate is found, will add a remark and process the next row item. And if the next row isn’t a duplicate, I have to just process it.
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:44am
11
Is the output that I have given is not reached your expected output… @uio
If not then show me an example then we will provide the solution for your query.
uio
(uipath test)
March 21, 2024, 6:51am
12
I was exploring methods and found this method will suit for my flow.
ComparingTwoExcelsToFindDuplicates.zip (4.5 KB)
Thank you for your support.
Since the method you gave works for my initial requirement, marking it as a solution.
1 Like
system
(system)
Closed
March 24, 2024, 6:51am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.