Edit: Problem solved thanks to Merlin, who suggested:
You could always zip the entire directory structure, then unzip to a location without restoring the paths. This would essentially flatten your entire directory structure to a single level.
Just why a man of such brilliance and good taste would be hanging out here will remain one of life's little mysteries.
My thanks to everyone else for their help, as it is truly appreciated.
I have a directory e:\foo, and under that I have many subdirectories:
e:\foo\foo_a
e:\foo\foo_b
e:\foo\foo_c
e:\foo\foo_d
e:\foo\foo_e
and under those, many other subdirectories:
e:\foo\foo_a\foo_1
e:\foo\foo_c\foo_2
e:\foo\foo_e\foo_3
and at the end of each tree there may be a file:
e:\foo\foo_a\foo_1\foo-file1.xxx
e:\foo\foo_b\foo-file2.dox
e:\foo\foo_c\foo_2\foo-file6.crp
e:\foo\foo_d\foo-file7.asc
e:\foo\foo_e\foo_3\foo-file99.099
I want a utility to navigate the tree, and when it finds a file I want it to copy that file to a single directory, such as:
e:\MyCollectedFiles
thus putting all the files in one place and eliminating this tree. I've looked and haven't found anything except sites offering free spyware.
Is there such a utility anywhere?
4 comments:
You could always zip the entire directory structure, then unzip to a location without restoring the paths. This would essentially flatten your entire directory structure to a single level.
Disclaimer: I'm a linux guy, not a windows guy.
But... the standard answer in the linux world would be to write a short script to do stuff like this. While I suspect that it would be very difficult to create a .bat file using standard console commands to do this, it would not be that hard using a scripting language that can be installed on Windows, such as Python or Perl.
There's a little bit of a learning curve, but once you get the hang of it, it becomes second nature.
Here's a site discussing a similar problem using Python:
https://stackoverflow.com/questions/3964681/find-all-files-in-a-directory-with-extension-txt-in-python
Here's a site discussing a similar problem using Perl:
https://alvinalexander.com/blog/post/perl/generate-all-html-files-in-directory
DOS copy command, with wild cards?
Copy e:/foo/*/*/* e:/myflattenedstructure/
Is what I'm thinking.
Post a Comment