I have a folder X:\Export that has several folders:
X:\Export
+---Export1
| \---various files …
+---Export2
| \---… and subfolders
+---Export3
| \---etc.
\---etc. (names vary widely)
Each “Export” folder has the same subdirectory structure, but they have different files (with possibly some name collisions). I would like to copy all the subfolders and the files of X:\Export\Export1, X:\Export\Export2, X:\Export\Export3, etc., to a folder X:\Export\merged, keeping the subdirectory structure.
Pseudocode of what I would like to do but cannot get working properly:
create new folder "merged"
for (every folder X in a given directory Y (i.e., X:\Export)
copy every file in X keeping directory structure to "merged"
If conflict then overwrite
No comments:
Post a Comment