I have an excel in which the column names can contain multiple spaces between them.
For ex: Invoice Data is written as Invoice Data (multiple space).
I want to rename such columns with proper names by only keeping one space between each word.
Hi @SunnyJha
Use this Expression to remove the spaces: Regex.Replace(STR, " {2,}", " ")
Iterate through the column names
Input Screenshot:
Solution
RemoveSpacesFromColumns.xaml (9.1 KB)
Sample.xlsx (8.7 KB)
Output Screenshot:
The solution attached will replace all the column names in your file with single spaces and remove the additional Space at the end of column name as well.
Thanks
Happy automatioN!
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.