How to Separate Duplicate Data?

Hi,
I want Separate duplicate data and put that information on another sheet.

Test.xlsx (9.4 KB)

Can you help me ?

Thanks.
Perawat

Hi

Welcome back to UiPath forum

Hope this thread will help you get the duplicate records which we write in another excel with write range activity

  1. First use a excel application scope and pass the file path as input and get the output as datatable with read range activity named dt

  2. Then use a assign activity and mention the below expression in left side and dt in right side

  3. Then write dt to a excel with write range activity

Cheers @Perawat

1 Like

Hi @Perawat

Please try this,

  1. Read the excel sheet data using read range (uncheck AddHeaders) in the datatable variable name dt.

  2. Use write range activity and give sheet name as “output”, datatable as below,

(From dtRow in dt.asenumerable
Group dtRow by k = dtRow(0).tostring.trim into grp = Group
Where grp.count > 1
Select grp(0)).copytodatatable.defaultview.totable(false,dt.columns(0).columnname)

For the reference

Thanks

1 Like

Hi @prasath_S

How do I use the code?

2

@Perawat Paste the code in the datatable field in write range.

Make sure read range output variable name is dt

Thanks

@prasath_S
I didn’t get the results I wanted.
I want to display duplicate data.

Thanks

@Palaniyappan , Thank you so much for your help. :grinning:

1 Like

@prasath_S , Thank you so much for your help. :grinning:

1 Like

@Perawat think i missed a condition there,my bad o updated my query hope it will work now.

Glad your issue is resolved.

Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.