I have files in one directory and based on target date, I want to replace those files present in another directory. Basically I want to update the latest file from 1st directory folder to another. I have designed all the logic, I am just not able to write the output in the second directory.
Hi @NISHA_373
You have two options here:
1. Read file from second folder using Dynamic Input and write it to the first folder using [FullPath] from the first Directory tool. Workflow will looks more or less like this:
Output tool and dynamic path:
However this solution will works for one file at the time, if you need it for many files I will recommend to create a batch macro (one file per batch)
2. Use Run command tool. I will prefer that solution as it dose not need to reed data, just to take one file and overwrite in second destination.
Workflow will just need both full paths and command should like this "copy /y "C:\Temp\Folder1\Test.xlsx" "C:\Temp\Folder2\Test.xlsx" (where C:\Temp\Folder1\Test.xlsxis [FullPath] from one folder and C:\Temp\Folder2\Test.xlsx is the Destination folder + filename)
Workflows should looks like this:
This solution also will works if you want to MOVE file not only copy
Hope that helps you :)
Sebastian
File extension type is .cmd and not .xlsx. That's where I am facing the main issue
Please try attached solution.
I used same file in both location (so in the Join tool it is joined based on FullPath from both folders. So if the file name is the same it will be copy (in my example moved from folder 1 to folder 2. In the Run Command tool you can check how it is configured (in simple words, I am creating a cmd in Formula, it is outputted to temporary file %temp%\rmdir.bat (I should change the name but already attached :P) and in Command it is calling that temp file saved as BAT.
In cmd (in formula I used "MOVE" instead of "Copy" to check if command is working) so you can change it again to COPY.
If that solution works, please tag this response as SOLVED :)
Thanks,
Sebastian
Hi @NISHA_373
Dose the solution works for you? If yes, please tag my response as Solved.
Thanks,
Sebastian
User | Count |
---|---|
53 | |
27 | |
26 | |
24 | |
21 |