Rename Duplicate Column in Data Table

Hi,

I Have this scenario.

  1. I Have multiple excel files with chances to have a duplicate column in header name
  2. I want to find if the excel file has a duplicate column name and then rename it with a running number, example in the column name I have column name, address, address I want to rename it to name, adrress1, address2 before I read range the excel file with option AddHeaders tick.

Thanks

@rangga.waskita

Inside of renaming the header names

You can do without that as below

Use Read Range and remove the Add headers option
Now you can use your automation using the index of the columns

like dt(0)(1)

Which is datable 0-> 1st row and (1) will be the column

Hope this may help you

Thanks

Hi @Srini84 ,

Because the excel file that I working is random, how I can find the duplicate value if I don’t know which column has a duplicate value?
for example, the address column could be the first column or it can be the second column

Thanks

@rangga.waskita

Okay, Check below post for your reference

Hope this may help you

Thanks

Thanks @Srini84,

1 Like

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