Hi I'm looking for a quick way to remove folders with only 1 item (the subfolder), but preserving the hierarching
e.g
folder1
emptyfolder
emptyfolder
folderwithcontent1
folderwithcontent2
Becomes:
folder1
files from folderwithcontent1
files from folderwithcontent2
-imtrobin
To make this clear, do you mean:
Becomes:
folder1
folderwithcontent1
folderwithcontent2
e.g.
folder1
emptyfolder
emptyfolder
folderwithcontent1
folderwithcontent2
e.g. Step 1
folder1
emptyfolder
emptyfolder
folderwithcontent1
folderwithcontent2
e.g. Step 2
folder1
emptyfolder
emptyfolder
folderwithcontent1
folderwithcontent2
e.g. Step 3
delete all empty folders
That can be done with an script i think:
- get an array-list of all sub-folders
For Each folder in Array
- go to each deepest sub-folder
While parent != folder1
- IF (my-parent-folder IS without files) THEN move this-folder-and-all-subfolder one hierarchy up
- go to parent
Loop
Next
- then delete all empty sub-folders