I’m looking for a way of finding out when there are child directories (however deep) which have only one folder and bringing them up one, (e.g. to save double clicking as well as reduce chance of >256 path name).
So I would like to basically identify when I have
and in those cases then pick the name of the lowest subfolder, bring it up to the top and delete the others
ending up with
I know it sounds greedy to be adding this also to the question but…
In the case where you have
then I would like to end up with
Does this make sense? I’ve been trying it with a script but I end up tying myself a little into knots with nested ifs and repeated logic… where it feels like it could be more easily solved by doing some sort of recursive “uplevel” function which would start at the deepest level of the tree and keep stepping backwards until it has cleaned all the useless directories.
PS: I’m not expecting someone to do all the work for me… I won’t really learn that way, but if you know how to solve the problem and can give me a few hints and tips I’ll try to work it out myself and then post the answer back!