Mass moving of files into folders based on file name
Posted on 2006-06-21
I have a few thousand files that due to a poor attempt at orginization by myself were dumped into a single directory.
The file names are on the order of wwXXXX-YY-ZZZZZZZ-.ZIP where
ww is the same
XXXX is a four digit number
YY is a two digit number
zzzzz is a varible length descriptor.
I need the script to do
1) Make a directory called wwXXXX
2) Move everything that matches wwXXXX* to the just made directory
3) increase XXXX by 1
4) Repeat until everything is moved correctly.
I started writing a batch file where I could specify the wwXXXX but I realized it would take me a few days to do this by hand and there has to be an easier way
The .CMD script I am using is
move ..\..\no%1-*.* .