topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 8, 2024, 12:41 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Utility to find UNIQUE set of files  (Read 5314 times)

edcu

  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Utility to find UNIQUE set of files
« on: July 31, 2009, 10:18 AM »
Hi,

I need an utility to find UNIQUE set of files across a specified set of multiple locations (either drive letters or folder paths). In short, if the file occurs ONLY at ONE of the locations provided without being present at any of the other locations, I need to identify these files. This is to ensure that I back them up as soon as possible.

I need to use this to find files that are not available in my backup sets across multiple locations. Normal utilities for duplicate finder only finds duplicate files across multiple locations and not the other way around.

Folder synchronization utilities finds missing files but they do not accept more than two locations at a time and hence cannot be used to find unique files across more than two sets of locations.

If anyone is aware of such an utility existing, please send me the URL for same.

Thanking in advance,

Edcu

yksyks

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 476
    • View Profile
    • Donate to Member
Re: Utility to find UNIQUE set of files
« Reply #1 on: July 31, 2009, 10:46 AM »
ZTree can do this (and much more). If you want to give it a quick run, here's how to perform your task:

  • Log any folders you want to include in the search by pressing "Enter" or "+" for current level, "*" for the whole branch.
  • Press "S" for Show all.
  • Press "Alt-F4" for Compare.
  • Press "U" for Unique names.

All unique files are now tagged and you can move them (Ctrl-M) or copy (Ctrl-C) or rename (Ctrl-R) or whatever.

You can also create macro for such a task.

Good luck!

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: Utility to find UNIQUE set of files
« Reply #2 on: July 31, 2009, 11:52 AM »
Interesting request...

Here's a tiny AHK script. I'm just an amateur script writer, so I'm sure it can be done much better, but it works (at least on my system). Please do some testing of your own.

See attachment for compiled AHK script + source

1.) edit the ini file and enter the paths you want to check
2.) run unique.exe

Spoiler
#NoEnv
;#NoTrayIcon
#SingleInstance ignore
SetWorkingDir,%A_ScriptDir%
Splitpath, A_ScriptFullPath,,,,title

FileDelete,%A_Temp%\%title%_output.txt

Loop,Read,%title%.ini
{
Loop,%A_LoopReadLine%\*.*,0,1
Files = %files%`n%A_LoopFileLongPath%
}

Loop, parse, Files, `n
{
SplitPath, A_LoopField, FileName, DirName

StringReplace, Files, Files, %FileName%, Nothing, UseErrorLevel
If Errorlevel = 1
{
If Unique =
Unique = Unique files found:`n`n%DirName%\%FileName%
else
Unique = %Unique%`n%DirName%\%FileName%
}
}

If Unique =
MsgBox, No unique files found.
else
{
FileAppend, %Unique%, %A_Temp%\%title%_output.txt
Run,Notepad %A_Temp%\%title%_output.txt
}

« Last Edit: July 31, 2009, 11:56 AM by wr975 »