Copy a file hierarchy without files and other refinements

V

vizion

Hi

1. I have need to duplicate existing file hierarchies maintaining copies of
the existing directory tree but without any of the files contained within the
hierarchy.

2. Refining the problem. I also have the need to duplicate existing
heirarchies as above however if there are directories with a specific name
anywhere within the tree I want to copy the files that are contained in all
directories having that name.

Simple Example:
Here is an existing tree for an image archive where existing images are
stored in their numeric order in a sub-directory created as images have been
downloaded into the archive. Each sub-directory is named according to the
range of image numbers it holds. These image directories may have a sub
directory called 'Selected' holding processed images.

The Image directories are, in their turn, sub directories within a month.
The months are subdirectories within a year.

I now want to create duplicate file hierarchy in which the image directories
are preserved but have no files but do have the 'Selected' directories and
their contents.


Dir_2008
Dir_01_Jan
Dir_12345_12377
file 12345
file 12346
file 12347
Dir_Selected
file 12346_processed

Dir_12377_12402
files
Selected
files
12403_12499
files
Selected
12500_12600
02_Feb
etc etc

I am current doing this every quarter on a Unix system but it means
transferring the hierarchy to a samba directory on a unix server, processing
it on the unix system and then shifting the results back to the XP x64 bit
system which is used for image processing.

Does anyone have any idea how such selective copying could be achieved on XP
x64

Thanks

Photographic Artist
 
P

Pegasus [MVP]

vizion said:
Hi

1. I have need to duplicate existing file hierarchies maintaining copies
of
the existing directory tree but without any of the files contained within
the
hierarchy.

2. Refining the problem. I also have the need to duplicate existing
heirarchies as above however if there are directories with a specific name
anywhere within the tree I want to copy the files that are contained in
all
directories having that name.

Simple Example:
Here is an existing tree for an image archive where existing images are
stored in their numeric order in a sub-directory created as images have
been
downloaded into the archive. Each sub-directory is named according to the
range of image numbers it holds. These image directories may have a sub
directory called 'Selected' holding processed images.

The Image directories are, in their turn, sub directories within a month.
The months are subdirectories within a year.

I now want to create duplicate file hierarchy in which the image
directories
are preserved but have no files but do have the 'Selected' directories and
their contents.


Dir_2008
Dir_01_Jan
Dir_12345_12377
file 12345
file 12346
file 12347
Dir_Selected
file 12346_processed

Dir_12377_12402
files
Selected
files
12403_12499
files
Selected
12500_12600
02_Feb
etc etc

I am current doing this every quarter on a Unix system but it means
transferring the hierarchy to a samba directory on a unix server,
processing
it on the unix system and then shifting the results back to the XP x64 bit
system which is used for image processing.

Does anyone have any idea how such selective copying could be achieved on
XP
x64

Thanks

Photographic Artist

Start a Command Prompt and type xcopy.exe /?. You will see a switch that
lets you copy folders only, without any files.
 
V

vizion

--
Photographic Artist


Pegasus said:
Start a Command Prompt and type xcopy.exe /?. You will see a switch that
lets you copy folders only, without any files.

Aha -- Thank you that solves the hierarchy problem very nicely.

I note there is a very useful EXCLUDE command but not not an include that
would have the effect of modifying the hierarchy command to instruct it to
include any files in a named directory.

On a unix machine I first copy the file structure and them generate an extra
list of file paths. I then use grep to find all the paths that include the
word 'Selected' and pipe the resultant list to a copy command to dump all the
files that are in 'Selected' directories into the appropriate directory in
the new hierarchy. It takes two lines in a shell. Is there a way of doing
something similar with XP x64?

Thanks for getting me started.

david
 
P

Pegasus [MVP]

vizion said:
Aha -- Thank you that solves the hierarchy problem very nicely.

I note there is a very useful EXCLUDE command but not not an include that
would have the effect of modifying the hierarchy command to instruct it to
include any files in a named directory.

On a unix machine I first copy the file structure and them generate an
extra
list of file paths. I then use grep to find all the paths that include the
word 'Selected' and pipe the resultant list to a copy command to dump all
the
files that are in 'Selected' directories into the appropriate directory in
the new hierarchy. It takes two lines in a shell. Is there a way of doing
something similar with XP x64?

Thanks for getting me started.

david

Use robocopy.exe. It has an /IF (include files) switch. You can get it from
here:
http://www.microsoft.com/downloads/...69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
 
T

Twayne

vizion said:
Hi

1. I have need to duplicate existing file hierarchies maintaining
copies of the existing directory tree but without any of the files
contained within the hierarchy.

2. Refining the problem. I also have the need to duplicate existing
heirarchies as above however if there are directories with a specific
name anywhere within the tree I want to copy the files that are
contained in all directories having that name.

Simple Example:
Here is an existing tree for an image archive where existing images
are stored in their numeric order in a sub-directory created as
images have been downloaded into the archive. Each sub-directory is
named according to the range of image numbers it holds. These image
directories may have a sub directory called 'Selected' holding
processed images.

The Image directories are, in their turn, sub directories within a
month. The months are subdirectories within a year.

I now want to create duplicate file hierarchy in which the image
directories are preserved but have no files but do have the
'Selected' directories and their contents.


Dir_2008
Dir_01_Jan
Dir_12345_12377
file 12345
file 12346
file 12347
Dir_Selected
file 12346_processed

Dir_12377_12402
files
Selected
files
12403_12499
files
Selected
12500_12600
02_Feb
etc etc

I am current doing this every quarter on a Unix system but it means
transferring the hierarchy to a samba directory on a unix server,
processing it on the unix system and then shifting the results back
to the XP x64 bit system which is used for image processing.

Does anyone have any idea how such selective copying could be
achieved on XP x64

Thanks

Photographic Artist

An ideal solution if you have time for a short learning curve would be
XXCopy.exe, available from xxcopy.com. Free version is not fully
functional but IIRC has all that you need.

Twayne
 
V

vizion

--
Photographic Artist


Twayne said:
An ideal solution if you have time for a short learning curve would be
XXCopy.exe, available from xxcopy.com. Free version is not fully
functional but IIRC has all that you need.

Twayne
Thanks everybody -- I seem to have a solution which saves me transfering 1TB
of files backs and forwards every quarter!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top