Rename column in datatable

Hi all,
I would like to rename a column which matches particular string in column.

HI @Naga_Abhishek_Reddy_Chepp

Check out the Video link

Can you share the sample input and expected output?

Assign activity: yourDT.Columns(0).ColumnName = “New Column Name”

The 0 is the column index, which you have to set for whichever column you want to rename. 0-based index, so if you want to rename the third column you’d use Columns(2)

Or you can reference by column name…

yourDT.Columns(“Old Column Name”).ColumnName = “New Column Name”

The problem here is the index might change and column name partially contains text

So use the column name.

Every column name is entirely text (string).

For example column name has value ‘Phone’ some other time it contains ‘Phone#’, so i need to change the whole column name as ‘Phonenumber’

Why is the column name different like this? That shouldn’t happen, and is the issue you need to resolve. What is creating the datatable? Read Range? Something else?

Are you sure you’re talking about the NAME of the column, not the data (the rows) in the column?

i am not using excel, I am using cv extract table. Thats the reason I am getting the column name differently each time

Set “AddHeaders” to false in the CV Extract Table activity’s properties. Then the columns will always be the same ie Column1 Column2 etc

the table is spanning to multiple pages, then multiple headers will be added

You can’t have multiple headers in a datatable. Each column has a name. There is only one name for a column.

Are you sure you’re talking about the column names and not the data itself, the values for the rows?

Again, turning off AddHeaders in the activity will make it so the datatable is created with generic column names.