Append to Folder name integer number of files it contains

Bulk Rename Utility How-To's

Append to Folder name integer number of files it contains

Postby Noteworthy » Sat Jun 11, 2022 10:12 am

The subject line says it all:
How to append to a Folder name the integer number of files it contains.

For example, if a folder contains 17 music files and the folder name is "Lennon, John" then the folder name should read Lennon, John (17).

I tried unsuccesfully to find whether such a question has already been answered.

Many thanks
Noteworthy
 
Posts: 9
Joined: Mon Jun 22, 2020 3:13 pm

Append (#Files) to folder-name

Postby Luuk » Mon Jun 13, 2022 9:10 pm

The bru will never look at another file or folder, while its renaming any file or folder-name.
If its me, Im just open a command prompt at the main folder, and then type a long command like...
For /f "delims=" %A in ('dir /b /s /ad^|sort /r') do @For /f "delims=" %B in ('dir /b /a-d 2^>nul "%A" ^|find /v /c ":"') do @echo "%A" "%~nA (%B)"

This presents to the screen like... "C:\Some\Folder\Path\FolderName" "NewFolderName (#)"
If satisfied with NewFolderNames (#), then change @echo ===> @ren to conduct the folder-renames.
Luuk
 
Posts: 803
Joined: Fri Feb 21, 2020 10:58 pm

Re: Append to Folder name integer number of files it contains

Postby Noteworthy » Wed Apr 16, 2025 3:50 pm

Many thanks.
I did not receive a notification of your reply.
I'm terribly sorry for this late acknowledgement.
Best regards
Noteworthy
 
Posts: 9
Joined: Mon Jun 22, 2020 3:13 pm

Re: Append to Folder name integer number of files it contains

Postby Admin » Wed Apr 16, 2025 7:36 pm

There is a new new JavaScript function that can do that : countFilesInFolder().
Admin
Site Admin
 
Posts: 2883
Joined: Tue Mar 08, 2005 8:39 pm

Re: Append to Folder name integer number of files it contains

Postby Admin » Thu Apr 17, 2025 8:54 am

It can also be done using renaming tag <numfiles>
Admin
Site Admin
 
Posts: 2883
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To