Auto create a new folder for each file, then transfer each file into its own folder

I have say 10 files in a folder/directory.
The files are named 01, 02 . . . . 10.
May I create a button that will generate 10 sub-folders (ideally, named 01 to 10)
then, transfer file 01 to folder 01, file 02 to folder 02 etc

I have tried:

but these create only one sub-folder into which all the files are transferred.


Rename TO={file}\*
1 Like

Thank you for your fast response.
How do I use 'Rename TO={file}\*' ?

When I asked "how do I use 'Rename TO={file}\* '", it was because it looked so simple in comparison with the buttons I had already tried.
Anyway, I pasted it into the Command Editor / Function, but without much hope . . . . . and it worked beautifully.
Thank you.

1 Like

(How) Can I prevent the extension from appearing in the folder names?
I know how to remove them easily enough, but if its possible not to have them . . .

{file} gives you the filename.
{file|noext} gives you the name without the extension.!Documents/Codes_for_passing_filenames.htm

1 Like

Thanks again