Truncate file names

Bulk Rename Utility How-To's

Truncate file names

Postby Phoenix » Sat Oct 19, 2024 10:08 am

Hi,

I'm new to using the software. I have tried some suggestions (as described in the forum) but with no success. An example:
Re: How to truncate the file names to specified length

Postby Luuk » Sun Jan 30, 2022 9:30 pm
To keep only the first 20-characters, can either use...

Remove(5) with From==21 and to==999
Regex(1) with Match==(.{20}) and Replace==\1

Basic user of computers. I have many files including in subfolders. I need to truncate all folders and files to within 143 characters as required by my Synology NAS to encrypt files. Of course I do not want to affect the file extensions. How would I do this for all folders, files including the hidden files?

I'd be most grateful for help. A screen shot would help and be even better. Thanks.
Phoenix
 
Posts: 3
Joined: Sat Oct 19, 2024 10:02 am

Re: Truncate file names

Postby Phoenix » Sat Oct 19, 2024 10:11 am

Synology states "The name of the encrypted file or folder cannot exceed 143 English characters..."
Phoenix
 
Posts: 3
Joined: Sat Oct 19, 2024 10:02 am

Re: Truncate file names

Postby Phoenix » Sun Oct 20, 2024 1:14 pm

Any help as I am struggling with this matter? Thank you
Phoenix
 
Posts: 3
Joined: Sat Oct 19, 2024 10:02 am

Re: Truncate file names

Postby therube » Mon Oct 21, 2024 4:35 pm

Synology states...


More here, What is the maximum allowed filename (and folder) size with eCryptfs?

Seems many factors may play in including whether you are encrypting the file name itself, & what character set may comprise the file names.

So potentially (maybe ?) you may be able to get by with 255 character file names.


Next thought would be, do you in fact have file name lengths > 143 (or some other size) characters?
With Everything, I'll do a search for path:len:>260 (or path:len:>143 ...) to search for "long file names".
(That search takes the path into consideration too, not just the file name itself. Everything probably can do the name only too, but I'm not sure how, offhand.)
(Oops, Everything.)


Then, how to shorten things... ?

If there is commonality to the file names, perhaps you can simply use an abbreviation to get things smaller.

So if you had file names like (& assuming they were in fact much longer):

RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_08.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_07.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_06.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_05.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_04.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_03.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_02.pdf
RP 17802 Addendum No 3-Dwgs and Bid Clarifications-Page 1 to 22-SIGNED (003)_01.pdf

(depending...) maybe simply changing Addendum to Add & removing Clairifications & Page, entirely, would be sufficient.

RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_08.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_07.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_06.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_05.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_04.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_03.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_02.pdf
RP 17802 add No 3-Dwgs and Bid - 1 to 22-SIGNED (003)_01.pdf

If more diverse names... ?
therube
 
Posts: 1427
Joined: Mon Jan 18, 2016 6:23 pm

Re: Truncate file names

Postby Admin » Tue Oct 22, 2024 1:17 am

Hi, just to add to that, in BRU you can show just the file names and/or folder names longer than X chars with Name Min / Name Max in filters (12).
Then you can rename just those.
Admin
Site Admin
 
Posts: 2883
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To