Hi everybody....first post for a while, but simply cannot find a fix on the net, and as need this for work urgently, I am seeking your expert assistance!!!
So I have one big folder with multiple subfolders (some with their own subfolders) which are each labeled with a different name (of variable length).
There are multiple files in each folder, some with multiple subfolders, but all files are of various formats, but no file greater than 200k.
What I need is a macro / code, to go through each and every subfolder and label each and every file in that folder with the name of that particular folder at the beginning of each file.
In the case of subfolders from the large root folder BUT WITH NO Further subfolders......e.g. FOLDER 123
With files a.doc, b.whatever and c.somethingelse BECOMES
123_a.doc, 123_b.whatever and 123_c.somethingelse
However, the FOLDER 123 may well have its own level of subfolders (for example) labeled Red, and Blue.
If there are subfolders, then……
In the subfolder called Red there are files fish.xlsx and chips.whatever, whilst in subfolder Blue there are files called saltandvinegar.somethingelse and hopethisallmakes sense.doc........therefore these BECOME:
123_Red_Cheese_fish.xlsx, and 123_Red_Cheese_chips.whatever, whilst the files in subfolder Blue become: 123_Blue_Cheese_saltandvinegar.somethingelse and 123_Blue_Chopethisallmakes sense.doc
etc etc.
There will be numerous levels of subfolders in any folder (max about 5 levels), so the length of the 'new' file names may be rather long, but I hope that my example shows what I am looking for.
In an ideal world, I would really love these 'renamed files' to be transferred to a single new folder located say on the desktop, but if you can assist with this "renaming" convention, this would be a huge help!!!
I know this is a big ask, but I truly am stuck and as there are several thousand subfolders all with a shed load of files, I really need your expert help, as otherwise it may well take days / weeks to do this manually!!!
Many thanks for looking.
Skyping
Bookmarks