partial renaming - automatic

Advanced Renamer forum
#1 : 30/03-22 14:23
Achilleas Brintizis
Posts: 3
Hi

I have some questions :

I have this file name '' 435_BA_182358_21032022_05_1324110.pdf '' and I want it to be renamed '' BA0000182358.pdf '' . the numbers after the letters are always 10. , so " _ " will have to be replaced with so many " 0 " that the numbers become 10.

and if there is a way to schedule an automatic. example every 5 minutes to run the program alone.

Thanks
#2 : 30/03-22 16:05
David Lee
Posts: 1125
Provided we can use the first two underscore characters as separators:

Use a Replace method to extract the prefix and number...

Replace: [^_]*_([^_]*)_(\d*).*
with: \1\2
Use regular expressions

Then use a Renumber method to sort out the zero-padding...

Number position: 1
Change to: Relative to existing number
Number difference: 0
Zero padding: Manual
Number length: 10

Regarding automation: you can save your method batch as a .aren file which you can then run from a Windows command line or batch file using "Command line automation".

See the User Guide for details: https://www.advancedrenamer.com/user_guide/comma ndline

Advanced Renamer has a "Command line configuration utility" which will help you set up the command line. Unfortunately this is not described in the User Guide but you will find details in the "What's new" page: https://www.advancedrenamer.com/whatsnew
Scroll down to Version 3.61 (14. jan. 2014) or search on the page for: "command line utility"

Add the command line to a .bat file and then create a Windows Scheduled Task to run it whenever you wish (Google for instructions how to do this).

edited: 31/03-22 02:31
#3 : 31/03-22 13:46
Achilleas Brintizis
Posts: 3
one more question

In Command Line Configuration , how can I rename and transfer files at the same time?

Thanks
#4 : 31/03-22 15:11
David Lee
Posts: 1125
Reply to #3:
I've never tried but it looks blindingly obvious!
Try setting Batch Mode and Destination Folder
#5 : 13/04-22 14:22
Achilleas Brintizis
Posts: 3
Hi Again

this pdf 435_BA_182183_16032022_05_1323811 rename to

OTR_BA00000182183

it can be done ?

Thanks in advance
#6 : 13/04-22 22:20
David Lee
Posts: 1125
Reply to #5:

I've already answered this question.
The difference to the original answer is trivial and should be obvious if you bother to think about it!

Use a Replace method to extract the prefix and number using "_" as a separator.
Then add a Renumber method to fix the zero-padding.

1) Replace...
Text to be replaced: [^_]*(_[^_]*)_([^_]*).*
Replace with: OTR\1\2
Use regular expressions

2) Renumber...
Number position: 1
Change to: Relative to existing number
Number difference: 0
Zero padding: Manual
Number length: 11

edited: 13/04-22 22:23