Line Breaks Handling in Excel Column Headers (Column Name is in multiple lines in cell)

Hi @Irfan_Musa

Here is a solution to change the Column Names of a data table by removing nextline characters:

The Process Flow:

  1. Use a For Each Activity.
  2. Under the In property: dt_Data.Columns. This will make the Item set to currentDataColumn automatically.

  3. Use an Assign Activity with the following Code:
currentDataColumn.ColumnName = currentDataColumn.ColumnName.Replace(Environment.NewLine, " ").Replace(vbCrLf, " ").Replace(vbLf, " ")

The Output:
As you can see in the below screenshot from the Immediate panel. The dt_Data before and after the for each/

If this solves your issue, Do mark it as a solution.
Happy Automation :star_struck: