This UiPath project identifies duplicate column names in an Excel file, renames them to be unique by adding round brackets and numbers.
- The workflow reads the header row of table based on the provided path, sheet name, and header row.
- It identifies any duplicate column names.
- Duplicate column names are renamed to unique names to ensure clarity and ease of use For example as; Name (1) Name (2)
- The updated column names are saved back to the Excel file.
- After execution, the Excel file's column headers will have unique, readable names.
- ExcelFilePath (String): The path to the Excel file where the columns will be renamed.
- Sheetname (String): The name of the sheet that contains the table.
- Header Row (Integer): The starting row of the table headers. For example, 1 is the first row of the Excel sheet.
Suppose you have an Excel sheet with the following setup:
- File Path:
C:\Users\Example\Documents\Test.xlsx
- Sheet Name:
Sheet1
- Header Row: 1
If the file contains duplicate columns like Name
, Name
, the workflow will rename these columns to Name (1)
, Name (2)
to make them unique.