How to use replace if i have same headers in excel

Hi every one,

I know how to use the replace method I use for each activity and inside an assign activity like this -->

row(“Name”) — row(“Name”).ToString().Replace("-", " ").

Screenshot_4

But I have a problem because my excel has the same headers, how can i use Replace method?

Screenshot_3

Thanks in advance

hi @salvatore.quimi,

  1. The Data available in the excel is having duplicate header name so if we attempt to read the table from A: F with read header On - we would not be able to read as DataTable cannot have duplicate headers.

  2. we cab Read the Data without Header and then Uiptah will assign Header Names as Column0, column 1 and so on.

3.For Renaming , then we can use : column0 , column1 - To get these names - you can run the process in debug mode and quick watch the Datatable after the excel read.


Mukesh

1 Like

thanks for your reply @mukeshkala , I forgot to say that as you have already explained well, I know that removing hearder to read range activity I will have “Column1,…”, but do you know how to use Replace method even with this problem already highlighted???

dataTable.Columns[“OldColumnName”].ColumnName = “NewColumnName”;

Reference:

1 Like