sparker1970
asked on
Find and Copy Specific Files from a Subfolder Tree
I have 5 years of historical data in drill-down folders (by year, then by month, then by day). I am trying to find and copy all files in the folder tree named Financial_300.txt into 1 centralized location. I do not want to move the originals, just make a centralized copy I can then use in a database or for easier searches. I believe the basic XCOPY command will pull the subfolders along with the file so I am possibly looking for a different solution than XCOPY (unless there are switches in the parameters that would make it work).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you move multiple copies of the same file named "Financial_300.txt" to a single destination folder, they will overwrite each other, or not be copied at all. What's your intention with managing the file name in the destination?
~bp
~bp
ASKER
I've requested that this question be deleted for the following reason:
The question was not asked properly and, once clarified, had no solution.
The question was not asked properly and, once clarified, had no solution.
A valid answer was posted in http:#a41370650.
It will find all files named Financial_300.txt in a subfolder structure build as \YYYY\MM\DD\, and copy them to a central folder, while adding the date built from their respective folder structure to their name.
It will find all files named Financial_300.txt in a subfolder structure build as \YYYY\MM\DD\, and copy them to a central folder, while adding the date built from their respective folder structure to their name.
As before, it's in test mode; remove the -WhatIf at the end of line 9 to run it for real.
Open in new window