UiPath | Remove Duplicate Rows from Excel / DataTable using two columns | Delete Duplicate Rows LINQ

Опубликовано: 07 Октябрь 2024
на канале: Act Automate
5,051
57

#rpa #uipath #collectionmanipulation
👉 𝐄𝐧𝐠𝐥𝐢𝐬𝐡
● This video is about how to delete duplicate rows in a table in Excel using two columns.
● So the point is to delete the rows if the content of two columns is duplicated, that means, the value in the two columns exists in more than one row.

👉 𝐆𝐞𝐫𝐦𝐚𝐧
● In diesem Video geht es darum, wie man doppelte Zeilen in einer Tabelle in Excel anhand zwei Spalten löschen kann.
● Also es geht darum, die Zeilen zu löschen, wenn der Inhalt zweier Spalten doppelt ist, das heißt, der Wert in den beiden Spalten existiert in mehr als einer Zeile.

🌟 𝗖𝗼𝗱𝗲
✔ ExcelDT.AsEnumerable().GroupBy(Function(a) Tuple.Create(a("Location").ToString, a("Zip").ToString)).Select(Function(b) b.First).copyToDataTable()

📝 𝗟𝗜𝗡𝗤 𝗩𝗶𝗱𝗲𝗼𝘀
𝗔. 𝗣𝗔𝗥𝗧𝗜𝗧𝗜𝗢𝗡 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
➊ 𝗧𝗔𝗞𝗘:    • UiPath | TAKE Function - LINQ | LINQ ...  
➋ 𝗦𝗞𝗜𝗣:    • UiPath | SKIP Function - LINQ | LINQ ...  
➌ 𝗧𝗔𝗞𝗘𝗪𝗛𝗜𝗟𝗘:    • UiPath | TAKEWHILE Function - LINQ | ...  
➍ 𝗦𝗞𝗜𝗣𝗪𝗛𝗜𝗟𝗘:    • UiPath | SKIPWHILE Function - LINQ | ...  

𝗕. 𝗣𝗥𝗢𝗝𝗘𝗖𝗧𝗜𝗢𝗡 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
➊ 𝗦𝗘𝗟𝗘𝗖𝗧:    • UiPath | SELECT Function - LINQ | LIN...  
➋ 𝗦𝗘𝗟𝗘𝗖𝗧𝗠𝗔𝗡𝗬:    • UiPath | SELECTMANY Function - LINQ |...  

𝗖. 𝗙𝗜𝗟𝗧𝗘𝗥𝗜𝗡𝗚 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
➊ 𝗪𝗛𝗘𝗥𝗘:    • UiPath | WHERE Function - LINQ | LINQ...  

𝗗. 𝗤𝗨𝗔𝗡𝗧𝗜𝗙𝗜𝗘𝗥 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
➊ 𝗔𝗟𝗟:    • UiPath | ALL Function - LINQ | LINQ T...  
➋ 𝗔𝗡𝗬:    • UiPath | ANY Function - LINQ | LINQ T...  

𝗘. 𝗘𝗟𝗘𝗠𝗘𝗡𝗧 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
➊ 𝗘𝗹𝗲𝗺𝗲𝗻𝘁𝗔𝘁:    • UiPath | ElementAt Operator | Element...  
➋ 𝗘𝗹𝗲𝗺𝗲𝗻𝘁𝗔𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁:    • UiPath | ElementAt Operator | Element...  
➌ 𝗙𝗶𝗿𝘀𝘁:    • UiPath | First Operator | FirstOrDefa...  
➍ 𝗙𝗶𝗿𝘀𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁:    • UiPath | First Operator | FirstOrDefa...  

📝 𝐏𝐫𝐨𝐜𝐞𝐝𝐮𝐫𝐞
➊ Add Read Range activity and set the path and create DataTable variable
➋ Create DataTable variable: FilteredExcelDT
➌ Add Assign activity
➍ Set the code
➎ Add Write Range activity and add the path and the DataTable variable
➏ Check Add Headers
➐ Run the file to see the result

✍ 𝗞𝗲𝘆 𝗪𝗼𝗿𝗱𝘀
→ UiPath
→ UiPath Automation
→ UiPath Activity
→ Remove Duplicate Rows
→ Delete Duplicate Rows
→ Remove Duplicate Rows from Excel
→ Delete Duplicate Rows from Excel
→ Remove Duplicate Rows from DataTable
→ Delete Duplicate Rows from DataTable
→ Remove Duplicate Rows from DataTable Using LINQ Query
→ Delete Duplicate Rows from DataTable Using LINQ Query
→ Collection Manipulation
→ Excel Manipulation

👍    / @actautomate