Get all the files from a folder and merge them into a single file and write the final merged file.
Get all the files from a folder and join them and then write the final join data into a file.
[CheatSheet] - Filesystem APIs - News / Tutorials - UiPath Community Forum
Depending on the file Type (text, PDF, EXCEL) which was not mentioned within the above given use case description
it is of excel type
try to resolve please
-
Use a Directory.GetFiles activity to get all the Excel file paths from the folder.
-
Create an empty DataTable variable (let’s call it mergedDataTable) to store the merged content.
-
Use a For Each loop to iterate over each file path.
a. Inside the loop, use an Excel Application Scope activity to work with each Excel file.
i. Use a Read Range activity to read the content of each Excel file into a DataTable (let’s call it currentDataTable).
ii. Use an Add Data Row activity to add currentDataTable to mergedDataTable. -
After the loop, use another Excel Application Scope activity.
a. Inside this scope, use a Write Range activity to write the mergedDataTable into a new Excel file.