Moving a fix numbers of files to a new folder.

Status
Not open for further replies.

MaMister

Posts: 9   +0
Hi all,

I have a folder with around 80,000 files in it and would like to move them to 3000 files in each new folder.

Any suggestion?
 
the problem with COPY is keeping track of what was copied vs than remaining,
using move will show you what's left to be done.

if there's a problem, MOVE will stop and leave the remainder in the Source dir.

two means to this task; GUI move vs command line move

1- GUI
get two folders in Explorer (a) the source and (b) the target window
on the (a) window select the top file, scroll to some lower name, hold the SHIFT KEY and click. (ie multiple select).
Let go of SHIFT and right-click the last file and DRAG the selection into the (B) window
you get a menu - COPY or MOVE; pull down to MOVE​
interate back and do it again

2- command line
get a cmd prompt; then CD into the source directory

Code:
C:\Documents and Settings\Jeff>[B]move /?[/B]
Moves files and renames files and directories.

the issue here is moving a group of files like *.exe or *.jpg
moving ONLY one kind of files (say pictures *.jpg) you could do it
[INDENT]move a*.jpg targetA\
move b*.jpg targetB\
....
move z*.jpg targetZ\[/INDENT]

To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

  [drive:][path]filename1 Specifies the location and name of the file
                          or files you want to move.
  destination             Specifies the new location of the file. Destination
                          can consist of a drive letter and colon, a
                          directory name, or a combination. If you are moving
                          only one file, you can also include a filename if
                          you want to rename the file when you move it.
  [drive:][path]dirname1  Specifies the directory you want to rename.
  dirname2                Specifies the new name of the directory.

  /Y                      Suppresses prompting to confirm you want to
                          overwrite an existing destination file.
  /-Y                     Causes prompting to confirm you want to overwrite
                          an existing destination file.

The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.
 
Thanks, I understand the using of Explorer but is there is earlier way or tool that I can do it once instead of :

For 80000 files I need:
Create 27 folders.
Count 3000 files before draging over.

As I may have other folders or in future got to create 2000 files per folder instead.

Thanks for all reply.
 
MaMister said:
Thanks, I understand the using of Explorer but is there is earlier way or tool that I can do it once instead of :

For 80000 files I need:
Create 27 folders.
Count 3000 files before draging over.

As I may have other folders or in future got to create 2000 files per folder instead.

Thanks for all reply.
the command line MOVE is still a viable option. to see what would occur without actually moving anything,
get the cmd prompt, cd to the dir and enter
dir a*.*​
all the Axxx.xx files will be shown. Moving in this manner would subset the original dir into 26 subsets.
From there, you could move specific pieces to what you really intended.

If you had a CYGWIN environment, you could script the move by some criteria, eg date, groups of 2000, ...
 
Status
Not open for further replies.
Back