Shorten filename to certain lenght max characters

Advanced Renamer forum
#1 : 02/09-18 21:13
ReadLeaf
ReadLeaf
Posts: 3
What should be the correct code to shorten the filename by a max amount of characters?

I tried to use <Subst:0:40> but I cannot use it because it says that there is the error of have same filenames.


02/09-18 21:13
#2 : 03/09-18 19:54
ReadLeaf
ReadLeaf
Posts: 3
Reply to #1:
I cannot find a way, still.


03/09-18 19:54
#3 : 05/09-18 18:53
ReadLeaf
ReadLeaf
Posts: 3
Reply to #2:
Did I ask something weird?


05/09-18 18:53
#4 : 07/09-18 11:26
Kim Jensen
Kim Jensen
Administrator
Posts: 798
Reply to #1:
You can use that tag in the New Name method to shorten the filename. But I think you might have spelled it wrong. It should be spelled <Substr:0:40> not <Subst:0:40>


07/09-18 11:26
#5 : 24/09-18 23:40
Kyle Pierce
Kyle Pierce
Posts: 4
Another way to get there is to use the replace method:

Text to be replaced: (.{40})(.*$)
Replace with: \1
Use regular expressions (checked)
Apply to: Name

The (.{40}) selects the first 40 characters in the file name, so you can change that number to be whatever length you need.

File names shorter than 40 characters won't be changed.


24/09-18 23:40