Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two folders with different hierarchies. One is flat and the other is sorted by date(folders for month and sub-folders for date). I'd like to either flatten the hierarchy, create the hierarchy, or just have a program that can sync with the hierarchy difference.

I'm on Windows 7, but I have cygwin if there is a commandline diff I can run.

These are just pictures and movies. I have renamed the files in both directories according to the date taken, so I think I can just compare file names and don't need to care about file contents. Does this make this easier? Perhaps I can just list all files and then diff the two logs.

share|improve this question
    
You can look into rsync –  Scandalist Jan 20 '13 at 0:34

2 Answers 2

I feel sure that you could solve this problem with PowerShell or other scripting languages.

Get-ChildItem - Lists files. 
New Item - Creates folders
Copy-Item - Copy the files.
Compare-Object - Highlights differences.

P.S. Could you clarify if you want to create a permanent new structure, or to keep two existing structures synchronised. If the later then I would incorporate Task Scheduler into the solution.

share|improve this answer
    
I'm going to synchronize the structures, but I haven't decided which one to keep. –  Stuart Jan 21 '13 at 7:32
up vote 0 down vote accepted

It has been a while now since I came up with a solution, but I will try to recap it. I used find . -name '*' to get a list of all the files in both structures and piped it into two text files. I manually went in to the text file for the hierarchical structure and removed the folder names using regex find-replace on .*/\.*/\ in notepad++. Lastly, I removed any directories manually that were not done with the regex. Then I did a diff on the two log files to find the files that were not in both structures.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.