I've got 700+ folders with the same set of 200+ classic asp files (basically text files) in each folder. Over the years various people have made minor changes inside these asp files. I need an utility (for Windows) which can compare all the folders and files and identify all the different versions of the same files.

Does anyone have a suggestion?

  • 4
    Invent a time machine, go back to when you only had 1 folder of 200+ asp files, implement version control, back to today, problem gone away! ;) – Shevek Jun 17 '10 at 14:45
  • i so wish that was an option – Daniel Brink Jun 17 '10 at 14:49
  • have you considered asking at stackoverflow whether someone else has had a similar problem? Maybe with an un-scm-ed project... – Tobias Kienzler Jun 19 '10 at 18:33
  • Simply using command prompt you can effectively compare two files or folders Just see this funbutlearn.com/2012/10/… – Technology123 Oct 30 '12 at 17:49
  • 1
    Someone was telling me there's a built in Windows command in cmd called RoboCopy Also, there is an application called WinMerge that you can install on Windows to diff between files. It's going to take some time no matter which tool you pick – Kolob Canyon Sep 15 '16 at 17:16

Use git and a script to create one branch per folder in a single repository, then have the script try and merge them all into one. You'll be notified everytime files differ.

  • now that's a good idea! but if you want a perfect history it relies on knowing the order in which the 700+ directories were created – Shevek Jun 17 '10 at 16:44
  • @Shevek to be more precise, the order in which the files have been modified and even then you'd get only the last change. But hey, bash can do everything. But windows...? – Tobias Kienzler Jun 18 '10 at 6:10
  • have you considered how long it would take to do 700+ merges of a file tree containing 200+ files? I cringe even trying to imagine... – Evan Plaice Jun 18 '10 at 9:21
  • @Evan git's merge is quite smart remembering your previous merges and trying to minimize interaction. But yes, it would still be a Sisyphean task, I guess. – Tobias Kienzler Jun 19 '10 at 18:31

You could start by using a program like dupehunter to reduce the structure to the really differing files (of course you should start from a copied folder structure!). Then WinMerge can at least compare two folders.

  • jip, using a tool like dupehunter is helping. It looks like the majority of the files are the same across the folders, but I still need a way to see what the differences are inside the files which are not exact duplicates, 2000+ files. doing this one by one will take years – Daniel Brink Jun 18 '10 at 8:36
  • Thanks for the WinMerge suggestion. Saved my day. I need to compare two versions of the same project and with WinMerge I found all the differences in multiple nested folders in minutes. It tells you you if two files are identical or different and highlights the differences. – Oncel Umut TURER Sep 21 '16 at 14:24
  • @OncelUmutTURER Glad to hear :) Nothing beats OpenSource – Tobias Kienzler Sep 22 '16 at 17:54

What you're looking for is a File Synchronization application...

DirSync Pro is my personal favorite

Note: I know the 'pro' makes it sound like the average half-baked proprietary marketing crud but don't let it fool you. DirSync Pro is free, open source, and cross-platform

::wagging finger:: And, I hope you learn't your lesson from this debacle ;). Get those files under revision control and branch if you need multiple concurrent versions of development.

  • doesn't your solution just, you know, synchronize? I mean, won't this just overwrite all modifications with a single version? – Tobias Kienzler Jun 18 '10 at 6:14
  • @Tobias yes, if you choose to overwrite. I know where you're going with this... Why not propose a solution that can track the changes over time? Because that's not what he asked for, "compare all the folders and files and identify all the different versions of the same files". My solution will identify the different versions based on their file attributes because the step before synchronizing is to do a mass-compare. Where he goes from there is his decision. Personally, I'd just merge everything to the most current version and start a fresh history from there but I'm not the op. – Evan Plaice Jun 18 '10 at 6:21
  • unfortunately i cannot merge anything, each of those 700+ folders is a "custom" system used by clients. I'm trying to correct the problem by finding out what is the same across all the folders and replacing it with one central page, until there is only one central system remaining. Its never fun having to clean up legacy issues created by programmers who have left the company years ago, but it has to be done – Daniel Brink Jun 18 '10 at 8:28
  • @Daniel ooooh. When you said "the same set of 200+ classic asp files" you meant that the 700+ folders only constituted a few sets of the 200+ files. So what you're saying is, there are 200*700 ~= 140k files? Ouch... Well, dirsync will get you started doing a 1-1 folder comparison to see the differences but you'll still have to do it 700+ times. – Evan Plaice Jun 18 '10 at 9:01
  • 1
    @Daniel what you need is some script that crawls the 700+ directories and on a file-by-file basis and compares them line by line to pull just the uniques. Then, by comparing versions in relation to the last-edited dates in the file attributes, order them chronologically. Then, you could enter the just the delta (diff) of each subsequent version into a repository to build a history. The only issue is, there's no way to guarantee that you could maintain working functionality of the original versions. Is that an issue? – Evan Plaice Jun 18 '10 at 9:19

No idea for premade tools to do this. If you're comfortable writing a small script, you can iterate through the folders, keeping a map of filenames to file hashes. At the end you'll have all the information you need, though I don't know exactly how you want it presented, or how you intend to use it.

If you want something that semi-intelligently notices that file x in folder c seems to be based on the same file in folder b, which in turn was based on the same file in folder a (ie the software tries to infer a 'tree of edits' for each file) then I think it's a bit of a toughy.

  • i have no problem writing the app myself, but would rather not re-invent the wheel if someone else already wrote it – Daniel Brink Jun 17 '10 at 14:51

what you're looking for is source control. we use Tortoise SVN here at my company and love it. if you install "Tortoise SVN" for windows then that should do the trick. just create a repository, and import the oldest folder. after the base code is in SVN, bring down a "Working Copy". overwrite files in that folder with the next oldest folder, commit, repeat. i realize this is still pretty daunting with 700+ folders (or revisions) but there is not much else you can do when implementing source control this late in the game. after you have everything in SVN then you can get full history for every file individually.

  • 2
    TortoiseSVN is just a client (for Windows). You still need an Subversion server to actually do everything. – paradroid Dec 1 '10 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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