Scheduled AutoRename Questions

Post any Bulk Rename Command support requirements here. Open to all registered users.

Scheduled AutoRename Questions

Postby jameyho » Wed Jan 31, 2024 11:00 pm

I've used BulkRenamer for years at home on my pictures/videos library, but now I'm trying to automate a renaming job that happens daily in my lab. If I can show this works, I can purchase a commercial license for it and deploy it. Jobs will drop randomly throughout the day, so I would schedule the script to just run hourly in windows scheduler.

Files are dropped with full detailed filenames, plus a job code, but need to be delivered with just a job code.
B2405-2_ProjectTitleGoesHere_HM567823_Lab3.txt renamed to HM567823_Lab3.txt
B2405-4_LongerProjectTitleGoesHere_HM239876324_Lab5.txt renamed to HM239876324_Lab5.txt


I can do this in the #5 panel in the GUI, by simply saying Crop before HM and hitting Rename. Works perfectly. But I dont want to have to do it manually, Id' rather it go automatically, since some jobs will take a few hours to process and may not finish up till after hours. I would try the /copylast n, but the job numbers vary between 12-20 characters. Never consistent. Same with the project number/name, never going to be consistent. How would I script this to remove everything before the HM? is there a /crop command that I missed in the manual?
jameyho
 
Posts: 1
Joined: Wed Jan 31, 2024 10:42 pm

Cropping with /RegExp

Postby Luuk » Mon Feb 12, 2024 11:20 am

Would need to describe the differences between project-number/names and job-number/names/codes??

But for now, a very simple crop-command could just be something like.... /RegExp:.+_(HM.+)$:\1:
If "12-20" describes an ending job-code like HM567823_Lab3? could use... /RegExp:.+_(HM\d{5,13}_Lab\d)$:\1:
But if _Lab# sometimes needed more digits? then could use... /RegExp:.+_(?=HM.{10,18}$)(HM\d+_Lab\d+)$:\1:

All three will rename like...
B2405-2_ProjectTitle_HM567823_Lab3 -------------> HM567823_Lab3
B2405-4_LongProjectTitle_HM239876324_Lab5 ---> HM239876324_Lab5
Luuk
 
Posts: 771
Joined: Fri Feb 21, 2020 10:58 pm


Return to BRC Support