How can we avoid dupicates in excel i have only one header row?

in my case i have one excel sheet in that i need to elimanate the dupicates values present in the excel where i only have the one single row with hearder name “so_no”?

Hi @Naveen_Kanike

Check the Below docs

Hope it helps!!

iam not using the excel process scope

@Naveen_Kanike

image

No this is not working i tried

@Naveen_Kanike
Can you share the sample input

@Naveen_Kanike

Check the below thread

dummy.xlsx (26.6 KB)

@Naveen_Kanike

What is the sheetname you are working and expected output

Hi @Naveen_Kanike ,

Could you also explain how are the duplicates to be identified according to you for the data that you have provided ?

We see that there are multiple sheets present in it. We would need to understand how you would be able to recognise the duplicates in it.

We also do not see this header name in it.

Hi @Naveen_Kanike

→ Use Read Range workbook activity to read the excel and store in a datatable called dt_Input.
→ Then use the assign activity to remove the duplicates in a column.

- Assign -> dt_Input = (From row In dt_Input
                        Group row By a = row("so_no") Into grp = Group
                        Select grp.first
                            	).copytodatatable

The above LINQ Expressions will remove the duplicates in the so_no column in a datatable.

Hope it helps!!

in my case i dont know how many sheets will be there in my file so i used the excel process scope and use excel file and get workbook sheets to get the all the sheet names

@Naveen_Kanike

Okay. What is expected output from the file.

@Naveen_Kanike

Assign
To: dtUnique
Value: dt.AsEnumerable().GroupBy(Function(row) row.Field(Of String)("so_no")).Select(Function(group) group.First()).CopyToDataTable()

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