Folder Flatten & Segregate script - Has anyone...?

Discuss and share scripts and script files...
highend
Posts: 14658
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Folder Flatten & Segregate script - Has anyone...?

Post by highend »

Possible, but in comparison to the latest script: SLOW
- Folders would need to be sorted from longest to shortest (by nr of folder components)
- Each folder must be checked if it contains your criterias...

Or would it be ok if all subfolders of a folder are left out, if this "root folder" already fulfills the requirements (only 1 / 2 files / folders)?
Than the resorting of folders could be left out...

Worth the effort?
One of my scripts helped you out? Please donate via Paypal

starstuff
Posts: 29
Joined: 07 May 2015 15:30

Re: Folder Flatten & Segregate script - Has anyone...?

Post by starstuff »

it would be fine if subfolder will not be included after the root directory, it will only process the 1-level folder after the root directory, (not sure if that is the correct term), the rest of the folders/files/sub-folders after the 1-level folder would be used for checking, if there is more than 1 item then it will skip to another folder of the root directory

root directory - base directory to run script
Folder 1 - included in checking
Sub-Folder A - x
Sub-Sub-Folder A - x
Sub-Folder B - x
Sub-Folder C - x
Files A - x

Folder 2 - included in checking
Sub-Folder A - x
Sub-Sub-Folder A - x
Sub-Folder B - x
Sub-Folder C - x

highend
Posts: 14658
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Folder Flatten & Segregate script - Has anyone...?

Post by highend »

Sorry, I don't get it.
would it be possible to include a check if there is more than 1 item inside the folder then it wont process the folder and jump to the next folder?
-> Every folder (apart from the root folder itself) is skipped when it contains more than one item (regardless if it's files / folders or a combination of them)

Your:
Folder 1 - included in checking
Sub-Folder A - x
Sub-Sub-Folder A - x
Sub-Folder B - x
Sub-Folder C - x
Files A - x
already contains multiple folders so it fall into the restriction -> It should be skipped. Can't see the logic of what you've requested before...
One of my scripts helped you out? Please donate via Paypal

starstuff
Posts: 29
Joined: 07 May 2015 15:30

Re: Folder Flatten & Segregate script - Has anyone...?

Post by starstuff »

sorry for the late reply,
Or would it be ok if all subfolders of a folder are left out, if this "root folder" already fulfills the requirements (only 1 / 2 files / folders)?
Than the resorting of folders could be left out...
subfolders can be left out, only the root is processed.

Post Reply