Remove Duplicate Records using CSV File

Hi everyone, im new here in automation. may I ask how to remove duplicate records using csv file?
Thanks

1 Like

Hi @Louize_Ayuste

  1. Use Read CSV activity to read data from csv file and will give you output as DataTable and say it ā€˜DT’.
    https://docs.uipath.com/activities/docs/read-csv-file
  2. Then use the remove duplicate row activity.
    https://docs.uipath.com/lang-ru/activities/docs/remove-duplicate-rows

image

Hope this helps.

Hi @Louize_Ayuste
Please follow these steps.

  1. read csv.
  2. The DefaultView property returns a DataView you can use to sort, filter, and search a DataTable.

For Example :We can use the simple DefaultView Code to To Remove Duplicates From Datatable In UiPath

dataTable new_dt =
old_dt.DefaultView.ToTable(True)

Note:
Useful when we are removing duplicates with respect to every ā€œColumnā€

Hi @Louize_Ayuste,

  1. Use the ā€œRead CSVā€ activity to read the CSV file and store the data in a DataTable variable.
  2. Use the ā€œRemove Duplicate Rowsā€ activity to remove duplicate records from the DataTable variable. This activity removes duplicate rows based on all columns in the DataTable by default, but you can also specify a particular column or set of columns to remove duplicates based on.
  3. Use the ā€œWrite CSVā€ activity to write the cleaned DataTable variable back to a CSV file.