Users browsing this thread: 1 Guest(s)
A program which grabs files, throws them together and renames them
#7
As you can see in my first reply here, it adds the directory structure to the file name (with underscores instead of directory markers \).

In fact, it works this way:

Your base folder (the one you want the files to be in, instead of in subfolders inside that one) is "C:\...\basefolder\", so the program collects files in there. Let's say we have a file "C:\...\basefolder\subfolder\file.bin". First, we cut away the base folder and get "subfolder\file.bin", then we replace every "\" with "_" to achieve "subfolder_file.bin", then we add the base folder at the front so we get "C:\...\basefolder\subfolder_file.bin". Finally, we move the file (it's somewhat like renaming it). Now, the file "file.bin" from the subfolder "subfolder" is named "subfolder_file.bin" and located within the base folder.
So unless you had, for example, a file named "subfolder_file.bin" within the base folder itself to begin with, everything should be fine.

I could add a check whether a file with the new name already exists in the base folder and then add a number to the end. However, unless someone could need that, I won't do the work! ;-)
Thanked by: Garamonde, puggsoy


Messages In This Thread
RE: A program which grabs files, throws them together and renames them - by Previous - 11-30-2012, 02:31 PM

Forum Jump: