Rename headers in excel files

Hello everyone!
How to rename headers in excel files if the name of the header is not accurate. For example, there is an excel file with the heading “Cadastral and someting number”. You need to rename it to “Cadastral number”. Thanks for the help.

Hi @sereganator
try this appraoch

Regards,
Nived N
Happy Automation

Thanks, if “Cadastral and something number” is slightly different, for example “Cadastral and someting qewertrr number”, will this method work?

Hi @sereganator

Then u can try regex in if condition

Condition

System.Text.RegularExpressions.Regex.IsMatch(item.ColumnName.ToString,“Cadastral.*number”)

1 Like

Thank you so much!

1 Like

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