Creating folders based on number of files

I have hundreds of files numbered in consecutive number in one single folder

What I would like to do is to make as many subfolders as needed (dependeing on the number of individual files) and name them Folder01, Folder02, etc.
Then, move file01 to folder01, file02 to folder02 so on and so forth.
I have a bash script that does the job (usin For loops) but I am sure there should be an easier way to accomplish the same task.
Any feedback will be greatly appreciated.

Not sure of the performance:

 
ls | awk '{ print "mkdir file_"substr($0,length($0)-2)";mv "$0 " file_"substr($0,length($0)-2) }' |sh
1 Like

Posting your bash script would help us determine if we could do better.

Regards,
Alister

That's exactly what I was looking for! Just a little problem, my files are named like this:

SomeID1.sff
SomeID2.sff
SomeID3.sff
SomeID4.sff
etc

When I used your code the ext .SFF seems to affect the performance. If I remove the .SFF everything is fine. Is there a way to 'ignore the file extension?