Feature Request: Renaming all files in a group to one common name

English support for the software AllDup
Post Reply
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

I'm trying to organize a large file store where there are many identical files that have different names scattered among all the folders. When I do a byte-by-byte search (they're mainly image or video files), i'll get groups of 2 to maybe 20 exact copies of files (other than the name). Within each group, I'd like to rename those files so that they end up with the same filename. If any particular folders has a duped file, it’s fine if it appends a “Copy” descriptor.

At some level, I don't even care what the name is as long as it gets applied to the other files in that group.

I don't see a way to do this within AllDup (F2 on a group of files doesn't work and even if it did, it would be a manual action, not an automated option). There is an option to 'switch file names' within individual groups, but unfortunately, no option to set them equal in some defined way (for example: to rename each file in a group to the ith name in the group).

Currently, I’m exporting the groups with dupes to a .csv and creating batch files to do the renaming, but I believe it’s a good idea to consider for implementation. Of if that's too difficult, perhaps simply allowing F2 to operate on multiple files might be something to consider. Thanks.
therube
Posts: 322
Joined: 07 Nov 2012, 00:28

Re: Feature Request: Renaming all files in a group to one common name

Post by therube »

File Manager, allows you to 'Rename files'.

Experiment with that (safely) & see what that might be able to do?
IOW,
if you deselect (if necessary) 'Do not process groups with all files selected',
'Rename files' -> allthesamename.%2,
then all your same files should be named allthesamename.ext.

I've not tried the above.
Likewise, unsure what would happened on name collisions?
therube
Posts: 322
Joined: 07 Nov 2012, 00:28

Re: Feature Request: Renaming all files in a group to one common name

Post by therube »

Alternatively, a file renamer.
It would be a multi-step process...

Select a set of files from within AllDup.
(You can assign a hotkey to copy the file names to clipboard.)

Paste said names into a file renamer - that is assuming a file renamer allows you to paste a diverse set of file names into it.
Then use the renamer to rename the files with a common name.


ReNamer, http://www.den4b.com/products/renamer
Allows you to Paste "file names" into it - but... I think it is looking for "files" that were copied with Ctrl+C (kind of thing), where the file is actually copied.

Though in the case of AllDup, what it looks like is that the "file names, including path" are copied (to clipboard), & that looks to be different from copying the "file" itself (to clipboard). So while (den4b) ReNamer might work, it looks like it won't in this case? (I'm not 100% certain, but that is the way it is looking).
^--- that sounds weird, but there does look to be a difference between copying a set of files, & copying a set of file names+paths.


Everything, https://www.voidtools.com/
Everything does allow you to paste "file names, including paths" into it (including from AllDup).
Once there, select them, then F2 to rename (by whatever means works for you).

Offhand, not sure about name collisions in Everything, but it does have options, so maybe an option there will cover you?
(IMO, the 1.5alpha version is way better then the 1.4 Release - even though it is an alpha.)
Administrator
Site Admin
Posts: 4046
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Re: Feature Request: Renaming all files in a group to one common name

Post by Administrator »

All files in a group should be renamed to the same name but which name should be used?
The name of the first file in a group?
Does this make sense?
Im currently not sure how to implement a new & useful placeholder for the action 'Rename files' at the file manager in your case.
Administrator
Site Admin
Posts: 4046
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Re: Feature Request: Renaming all files in a group to one common name

Post by Administrator »

How about a new command like "Give all files in this group the same file name" available via the context menu of files and groups?
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Re: Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

thanks for the responses.

i forgot to mention that i did play with the renamer and as pointed out, collisions were a problem. It did warn of potential collisions when dupes existed within a folder and if you proceeded, it would rename the first file and then stop.

As to renamers, i do have the "Everything" program installed, but don't use it...might be faster than my current hackey approach...will play with that...

as to: "All files in a group should be renamed to the same name but which name should be used? The name of the first file in a group?"
i had suggested in my post: "to rename each file in a group to the ith name in the group)" but thinking again about that - it wouldn't work because certain groups may not have a 3rd or 4th or...listing. {"First" or "Last"} would theoretically work. {"Earliest" or "Latest"} would also (but then the user would need to specify a particular date (created, taken, modified, etc).

hmmm....selfishly, since i dont care what the name is, first or last would work for me if the collision thing within a folder weren't an issue. But i don't think that would for most.

i guess to process literally thousands of dupes, im left with exporting the results to a csv file and writing a script to parse/cull what i need and dump it to a batch file to execute.

thanks for your help...
therube
Posts: 322
Joined: 07 Nov 2012, 00:28

Re: Feature Request: Renaming all files in a group to one common name

Post by therube »

Everything - Renaming 4000 files to the same name.png
I selected ~4000 files, in the same directory.
(In this case, I loaded the directory, directly, rather then pasting 4000 file names in [which would take MUCH longer to do].)

Selected all the files, & in the rename dialog, set the wanted file name to, "allnamedthesame", & added a "counter" (if you will) - $number:. So the files will be named, "allnamedthesame.counter", with counter in this case, being 1..4000.


(The "counter", would make the file names "unique" - even though they are "allnamedthesame", & that would get around any collision issue.)


---

i do have the "Everything" program installed, but don't use it
I'm sorry to hear that ;-).
No one should be without Everything :-).
(But really though, it is an amazing piece of software.)
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Re: Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

for renaming, ive used "bulk file renamer" for years. but it's not the actual renaming that's the quandary, it's 2000+ groups of identical files in every way other than the filename. Some of those files are spread across folders; others are within folders; and yet others are both spread across and also within.

i was hoping that Alldup would generate groups of like files (it does!) and also have an automated way to give the files within each group a unique name.

Obviously, there are issues ranging from what name and what to do with collisions...

i think the solution for this (my?) particular problem is to take the csv output and simply let excel generate a batch file for the renames. i thought there could be a small corner problem (collisions if keying off the file sizes), but i now see the group number is output so that prob disappears.

thx
Administrator
Site Admin
Posts: 4046
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Re: Feature Request: Renaming all files in a group to one common name

Post by Administrator »

davidsrothman wrote: 26 May 2023, 23:39 Obviously, there are issues ranging from what name and what to do with collisions...
How did you solve the problem with the unique name using a batch file to rename your files?
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Re: Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

havent had the chance to do it, but forming a string (simply from within excel) from the csv file to generate a statement such as:

ren h:/f1/f2/f3/filnam.ext <"aaaaa_"&<excelrow#>.ext for each row

and then pasting into a batch file with pauses between some number of lines to make sure it's working is simple/quick.

if i need to, i can, later on replace it with something more meaningful (perhaps related to the folder name the file exists in).
Administrator
Site Admin
Posts: 4046
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Re: Feature Request: Renaming all files in a group to one common name

Post by Administrator »

With the next update some new placeholders for renaming files will be available which might be useful for you:

NEW: File Manager / 'Rename Files': With the new placeholder %FFILE%, the name of the first file in the group can be inserted into the name of a file.
NEW: File Manager / 'Rename Files': With the new placeholder %LFILE%, the name of the last file in the group can be inserted into the name of a file.
NEW: File Manager / 'Rename Files': With the new placeholder %GNAME%, the group name can be inserted into the name of a file.

Other changes:

NEW: File Manager / 'Rename Files': With the new placeholder %CDATE%, the creation date can be inserted into the name of a file.
NEW: File Manager / 'Rename Files': With the new placeholder %MDATE% the modification date can be inserted into the name of a file.
NEW: File Manager / 'Rename Files': With the new placeholder %PDATE%, the creation date of an image can be inserted into the name of a file.
UPD: File Manager / 'Rename Files': The placeholders must now be enclosed with a percent sign (%).
UPD: File Manager / 'Rename Files': The filename placeholder %1 has been renamed to %NAME%.
UPD: File Manager / 'Rename Files': The file extension placeholder %2 has been renamed to %EXT%.
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Re: Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

that certainly solves the problem.

This morning, i did do what i needed to do by dumping to excel and via a simple excel formula creating rename statements for each file - which i then output to a batch file. Simple enough...

thanks very much for the assist.
davidsrothman
Posts: 10
Joined: 02 Aug 2022, 22:49

Re: Feature Request: Renaming all files in a group to one common name

Post by davidsrothman »

Admin - Thank-you for the timely update. I look forward to playing with it....
Post Reply