Hi,
I have a deep folder/file structure with thousands of files. I will be renaming certain files and folders with a hash character at the beginning of their filename. Then, I would like to delete all files and folders except the files/folders starting with a hash, keeping the folder structure intact for those files.
I hope what I say is clear.
Is there a fast way to do this with XYplorer?
Thanks!
Delete all except files/folders starting with hash
Re: Delete all except files/folders starting with hash
NoI hope what I say is clear.
What happens with subfolders of folders that start with a hash or files in them?
Code: Select all
.\#root
.\#root\no_hash_folder -> To be deleted?
.\#root\no_hash_folder\no_hash_file.ext -> To be deleted?
One of my scripts helped you out? Please donate via Paypal
Re: Delete all except files/folders starting with hash
Hi,
Thanks for asking, this way it's clearer. Any files or folders within a folder starting with a hash should not be deleted.
Thanks for asking, this way it's clearer. Any files or folders within a folder starting with a hash should not be deleted.
Re: Delete all except files/folders starting with hash
Then you could write a simple script that collects all folders, remove those that DO NOT start with a hash,
loop over the remaining ones, find all files and then delete all of them that don't start with a hash.
In a last step you could also remove those folders (not starting with a hash) that don't contain files
any more...
loop over the remaining ones, find all files and then delete all of them that don't start with a hash.
In a last step you could also remove those folders (not starting with a hash) that don't contain files
any more...
One of my scripts helped you out? Please donate via Paypal
Re: Delete all except files/folders starting with hash
Hi, thanks for your input. I'll see if I'll resort to scripting as I'm not that comfortable with it yet (I wrote my first script yesterday).
Re: Delete all except files/folders starting with hash
Perfect start to dive in deeperI wrote my first script yesterday
One of my scripts helped you out? Please donate via Paypal
Re: Delete all except files/folders starting with hash
And, any progress?
One of my scripts helped you out? Please donate via Paypal
Re: Delete all except files/folders starting with hash
Hi !
I've been too busy with other stuff so I haven't even tried for the time being.
I've been too busy with other stuff so I haven't even tried for the time being.