Need to remove duplicate columns from excel file

Hi, I have a scenario where I have to remove duplicate columns from the multiple excel files but am getting error as “Column already belongs to data table” while reading the file using read range activity. So without reading a file how can I remove duplicate columns, kindly suggest activities on the above scenario, if possible plz create one sample code it will be more helpful

Thank you

@Somanath_Somu,

Using Read Range activity you can do it just uncheck the property Add Headers This will read the data only and default unique column names as Column1, Column2 etc.

Once you read the data into a data table, you can delete the columns with column index and after that change the column names as per your requirement.

To change column names you got following two option:

1.Using Column Index:

yourDT.Columns(0).ColumnName = "New Column Name"

Here, 0 is the column index. This index is zero-based, so it starts from 0.

2.Using Column Name:

yourDT.Columns("Old Column Name").ColumnName = "New Column Name"