compare two folders with sub folders, copy files to third

May 30, 2015 at 18:26:56
Specs: Windows 7
I have two folders (Rev1), (Rev2); each with sub folders (G1), (E1), (M1) etc.

Folder Rev2 has files in it that may be in Rev1 also. The file names are similar, however, not identical. For example. ABCD(1234).pdf in Rev1 and ABCD(4321).pdf in Rev2. There are also unique files in both.

I want to be able to populate a third folder with a complete set of files where the Rev2 file ABCD(4321) would be copied to the third folder and the Rev1 version would not.

See More: compare two folders with sub folders, copy files to third

Report •

May 30, 2015 at 23:26:40
For a start, you get 10 points for a clear statement.
Which has become pretty rare around here.

Do the R1 & R2 vers strictly conform to:




M2 Get custom script or take private lessons

Report •

May 31, 2015 at 21:01:53
Yes. The files in the folders & sub-folders all conform to the format where the ABCD is the file name and the (1234) is a six digit date.

Report •

June 1, 2015 at 18:32:55
How to deal with unique files - each directory?
1) put all unique files from both dir.s into target
2) put only unique files from rev2 into target
3) (doubtfulest) put only unique files from rev1 in target.
What about the file's dates? Is there a consistant relationship (newer vs older). between rev1 and rev2 files?
What about subdirectories? Do you want to maintain the structure in the target? Or just lump them all together, or rename them with source subdir. name embedded in the target file's name?
Not trying to comp[licate things! Just the opposite. A few pertinant examples are worth a million posts...

Report •

Related Solutions

June 1, 2015 at 22:04:41
1) All files from both dir's are "unique".
2) The "base" would be the Rev1 dir as all unique files. Then Rev2 dir, which may contain some files with duplicate ABCD file names but different (1234) dates would be compared against the Rev 1 dir files. Note that only one of each file name will exist per entire dir.
3) Not sure what you mean? All files in both dir's are technically unique by file name, date created, date in file name, contents, but the newer Rev should supersede, i.e. overwrite the old rev. File created dates are not dependable sources of information. Only the (1234) date is reliable.

The newer Rev (Rev2 dir) would have a more recent date in the (1234) of the file name.

Ideally the same file structure would be maintained, but not necessary. No renaming files.

Example Structure.
Main Dir: Rev1
Sub Dirs: 01-Gen, 02-E, 03-M, 04-P
Files in Sub ABCD (1234), BCDE (1234), RSTU(1234)

Main DIR: Rev2
Sub Dirs: 01-Gen, 03-M, 04-P, 05-S ((Notice No 02-E))
Files in Sub ACCC (4321), ABCD(4321), GHIJ(4321)

Composite Rev2:
Main: Rev2-Composite
Sub Dir: 01-Gen, 02-E, 03-M, 04-P, 05-S
ACCC (4321), ABCD(4321), GHIJ(4321), BCDE (1234), RSTU(1234)

Information is knowledge.

message edited by dr85m

Report •

June 16, 2015 at 20:47:29
Beuler, Beuler, Beuler. Anyone, anyone, anyone.

Report •

Ask Question