Add an Auto Date to the middle of a file name

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Add an Auto Date to the middle of a file name

Postby Shacho » Fri Aug 19, 2022 7:39 am

RE: Section Auto Date (8) Please add the option to place the date either (1) with an option to replace a placeholder or (2) insert at position - perhaps both options could be added.
Alternatively could we add some simple date codes in the With field in the Replace (3) section; Replace field in RegEx (1). Apparently we can do this with the file creation date

example:
Replace "-" with the current system date in the format YYMM
Original - File Name.ext ===>> Original 2208 File Name.ext
With these files I will be replacing Original with something; - with the YYMM date but File Name.ext will remain unchanged.

While here:
What is the function of Off. at the bottom of the Auto Date (8) section?
It does not appear to do anything!
I thought it might be an offset for positioning the date, but this does not appear to be the case!
Shacho
 
Posts: 2
Joined: Mon May 28, 2018 2:29 am

Insert date-elements at middle of filename

Postby Luuk » Fri Aug 19, 2022 2:03 pm

Add(7) can 'insert' different date-elements, but Im not know of any <(codes)> to represent the current system-time???
So for now, Im thinking this must be conducted in two separate renames, unless using the brc command-line version.
Probably the easiest way for now, is first using "Special, Change TimeStamps", and set Date-Accessed to "Current".

Then you could use settings like...
RegEx(1) with Match==^Original -(.+) and Replace==Something \1
Add(7) with Insert==<($System.DateAccessed)> and At==11 (because 'Something ' is 10-characters)
AutoDate(8) with Custom==%y%m

The $FileProperty is what grants %y%m in AutoDate(8) to conduct against System.DateAccessed inside of Add(7).
There is many other ways to conduct this, but this method is most likely to help others with something similiar.
(if we really only wanted the system %y%m, I would just use RegEx(1) with 2208 inside of the "Replace")

Of course, the method would be much easier with <($System.Date)> or <($Now)> or if AutoDate(8) had Mode==Insert.
The Off. is to offset the hours, just in case somebody's time was set in a different time-zone or something.
But with %y%m, you would never see a difference, unless like adjusting -24 when its the 1st day of a month.
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm


Return to Suggestions