I have extracted the excel from database where I do not need space inside the column headers.How to remove the columns inside space from the column header.
Hi @sowjanya.s
-
Excel Application Scope:
- Input: Path to your Excel file
-
Read Range:
- Input: “Sheet1” (or the name of the sheet containing your data)
- Output: dt (DataTable)
-
For Each:
- Type Argument: currentItem
- Values: dt.Columns
-
Assign:
- To: currentItem.ColumnName
- Value: currentItem.ColumnName.Replace(" ", “”)
-
Write Range:
- Input: “Sheet1” (or the name of the sheet where you want to write the modified data)
- Range: “A1” (or the desired starting cell)
- DataTable: dtExcelData
Hope it helps!!
Will check on it.
Regards.
One of many options
- read in the excel - read range with headers - dt1
- For each Activity | item in dt1.Columns | TypeArgument: DataColumn
- Assign activtiy:
item.ColumnName = item.ColumnName.Replace(" ","")
- Assign activtiy:
- Write range with headers - dt1
Hi @sowjanya.s
Use for each to iterate through columns and use replace method to remove the extra spaces.
YourVariable .Split({Environment.NewLine,vbcrlf,vblf,” ",vbtab,vbcr,vbNewLine},StringSplitOptions.RemoveEmptyEntries)