Reformatting Date in file name

Bulk Rename Utility How-To's

Reformatting Date in file name

Postby matix1003 » Fri Jan 20, 2023 8:05 pm

I am trying to rename file dates, but have had no luck.. The final date format needs to be YYYY-MM-DD

Original:
Hawaii.Oahu.20.08.30.1080p.mp4

Changed to:
Hawaii - Oahu - 2020-08-30 - 1080p.mp4

Thanks!
matix1003
 
Posts: 6
Joined: Fri Jan 20, 2023 7:42 pm

Re: Reformatting Date in file name

Postby therube » Mon Jan 23, 2023 6:01 pm

1:RegEx
Code: Select all
Match:  (.*?)\.(\d\d).(\d\d).(\d\d)(.*)
Replace:  \1 - 20\2-\3-\4 -\5

3:Replace
Code: Select all
Replace:  .
With: "" (don't enter anything, i.e. not a physical "")

Match anything, non-greedy, up to a .
Match 2 digits
Match 2 digits
Match 2 digits
Match everything else

Reformat, sticking a physical "20" as the preface to the year.
(That also assumes no 19xx years.)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Reformatting Date in file name

Postby matix1003 » Fri Jan 27, 2023 6:57 am

Thanks for the response, I am very new to Bulk Rename Utility. It didn't seem to work...

The closest that I can get

RegEx

Match: (.*)(\d\d)(.\d\d).(\d\d)(.*)?

Replace: \120\2\3-\4\5

but my output is Hawaii.Oahu.2020.08-30.1080p.mp4

can't get "-" between year and get rid if the periods between Hawaii and Oahu and 2020 and 1080p
matix1003
 
Posts: 6
Joined: Fri Jan 20, 2023 7:42 pm

Re: Reformatting Date in file name

Postby matix1003 » Fri Feb 17, 2023 12:52 am

bump
matix1003
 
Posts: 6
Joined: Fri Jan 20, 2023 7:42 pm

Re: Reformatting Date in file name

Postby therube » Thu May 11, 2023 6:37 pm

1:RegEx
Code: Select all
Match:  (.*?)\.(\d\d).(\d\d).(\d\d)(.*)
Replace:  \1 - 20\2-\3-\4 -\5

3:Replace
Code: Select all
Replace:  .
With:  <sp> (that is a physical space, not <sp>)

Code: Select all
Hawaii.Oahu.20.08.30.1080p.mp4   
   -> Hawaii Oahu - 2020-08-30 - 1080p.mp4
Hawaii.20.08.30.1080p.mp4
   -> Hawaii - 2020-08-30 - 1080p.mp4


Image

(Other thread, viewtopic.php?f=4&t=6120.)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm


Return to How-To