Give HashTool an option to rename the file with the hash.

Other bits and pieces and old stuff!
Post Reply
Acura Photos
Posts: 9
Joined: Sat Nov 28, 2020 4:00 pm

Give HashTool an option to rename the file with the hash.

Post by Acura Photos »

Many of my image files have inconsistent naming. Having the hash for the file name would be great way to:
/1 disambiguate the image files
/2 create a unique name that doubles as an integrity check.

I would use this today on a tree of 150K image files.

Extra credit:

Allowing a prefix would be helpful. Like "bob-ec55d3e698d289f2afd663725127bace.jpg"
Additionally, an option to use the directory name as the prefix would be perfect.

.\bob\something.jpg
would be come
.\bob\bob-ec55d3e698d289f2afd663725127bace.jpg
User avatar
DigitalVolcano
Site Admin
Posts: 1715
Joined: Thu Jun 09, 2011 10:04 am

Re: Give HashTool an option to rename the file with the hash.

Post by DigitalVolcano »

Duplicate Cleaner 5 (beta) will be able do this -

You'd create a scan with all files -
Find Duplicates=No
Find Remaining=Yes

Rename marked files (with hash flag in prefix or suffix) (/h)
Acura Photos
Posts: 9
Joined: Sat Nov 28, 2020 4:00 pm

Re: Give HashTool an option to rename the file with the hash.

Post by Acura Photos »

That's great, thank you.
Any chance of getting some macros in there for the prefix? Like $FOLDERNAME for example? :)
Acura Photos
Posts: 9
Joined: Sat Nov 28, 2020 4:00 pm

Re: Give HashTool an option to rename the file with the hash.

Post by Acura Photos »

Heh, one last idea here...

Add the ability to match name replacements with a regular expression.
For instance, I want to replace all bad names like "02 (42).jpg", but not "Bob's 12th birthday.jpg"
Regular expressions would allow for this.
Acura Photos
Posts: 9
Joined: Sat Nov 28, 2020 4:00 pm

Re: Give HashTool an option to rename the file with the hash.

Post by Acura Photos »

So, ideally, you would match via regular expression, and construct the output file name with $ macros something like this:

Match: [regular expression here] // if matched

output: $FOLDER-$HASH.$EXT // example 1

output: "My Prefix"-$HASH.$EXT // example 2

output: $HASH-"my postfix".$EXT // example 2
Post Reply