Rename file when filename is shorter tan 3 characters

Advanced Renamer forum
#1 : 08/05-22 10:17
firemouz
firemouz
Posts: 3
Hello,

i want to rename tons of files in different folders at once.
The filenames are often the same "01", "02", "043", "044" and so on.
But i also have files with "good" names "holiday-2021-05-27".

Now i want to rename all files which have only 3 letters with "<DirName:1>-<Name>-" (=Foldername - filename)

But all files which are longer than 3 letters i do NOT want to rename. Only the short filenames with max. 3 letters.

(How) can i do this with advance renamer?


08/05-22 10:17
#2 : 08/05-22 13:35
David Lee
David Lee
Posts: 935
Replace: ^(.{3})$
with: <DirName:1>-\1
Use regular expressions

"^" : Beginning of filename
"(.{3})" : Capture exactly 3 characters
"$" : End of filename


08/05-22 13:35
#4 : 09/05-22 20:00
firemouz
firemouz
Posts: 3
Reply to #2:

Thank you for your answer. It works great, but it does only replace the files with exactly 3 characters.
I want to replace all files with up to 3 characters. So files with only 1, 2 or 3 characters.
Maybe with my bad english i explained it a litte wrong/bad.

Can you change it to "all files up to 3 characters" and not only the files with exactly 3 characters?


09/05-22 20:00
#5 : 09/05-22 22:40
David Lee
David Lee
Posts: 935
Reply to #4:
Sorry - I should have read your question more carefully!

Text to be replaced: ^(.{1,3})$


09/05-22 22:40
#6 : 10/05-22 17:31
firemouz
firemouz
Posts: 3
Reply to #5:
Great, thank you very much!


10/05-22 17:31