Changing YYYYMMDD-HHSS to YYYY-MM-DD HH:SS

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

Changing YYYYMMDD-HHSS to YYYY-MM-DD HH:SS

Postby Oyle » Mon Mar 09, 2015 9:22 pm

I am new to BRU and have tried to batch change files which all start with YYYYMMDD-HHSS (exported emails with eml extension).
For better readability I want to separate the year month and day as well as hour and seconds from each other either by a space or a dash (not an underline).
The sequence of year, month and date has to stay, otherwise the exported emails are no longer in chronological order.

I have tried to apply some of the suggestions made to others with similar request, but can't get it to work.

I'd really appreciate your support.

Thanks in advance
Oyle
 
Posts: 2
Joined: Mon Mar 09, 2015 9:16 pm

Re: Changing YYYYMMDD-HHSS to YYYY-MM-DD HH:SS

Postby spamspambaconspam » Thu Mar 12, 2015 1:29 am

You'll need to use the regex field for this, but I'll make it easy. :D
There is a caveat, though. You cannot use a colon in a filename.
I date all my files, and use a period between the hour and minutes, like so:

2015-03-08 06.08pm

Therefore, I've made this regex to use a period, so you don't have errors.
If you want to use the colon, I've added a second replacement line for you to use, instead.


Ready? Let do it :)

I always like to press the reset button (lower right), to make sure I've got a clean slate.

Un-check "Include Ext". It's right within the regex box area.

Copy this entire line to the MATCH field:
(be sure to include the little caret at the beginning :) )

^(\d{4})(\d{2})(\d{2})-(\d{2})(\d{2})(.*)

Copy this entire line to the REPLACE field:

FOR THE PERIOD:
\1-\2-\3 \4.\5 \6


FOR THE COLON:
\1-\2-\3 \4:\5 \6


There are probably better ways to write the regex, but this gets the job done, and you can tell people you were home writin' some regex. :wink:

cheers!

~spammy
spamspambaconspam
 
Posts: 6
Joined: Mon Nov 03, 2014 12:47 am

Changing YYYYMMDD-HHSS to YYYY-MM-DD HH:SS

Postby Oyle » Fri Mar 13, 2015 1:02 pm

Hello,

thank you so much for this solution - this works a charm ! And will be a great help in renaming thousands of files to be more readable.

I still need to tweak the formula a bit, as there are some dashes (-) and underlines (_) trailing after the HH.SS which I need to convert into either just a space or 2 spaces or a "space dash space" combo.

Also, some of file names contain accents (French ones, eg: é ô; German Umlauts etc.) which apparently are not allowed, at least not with the formula you sent me. Or BRU does not allow them.

I could either modify these manually (tho it would be a lot of work) or alternatively appeal to your goodwill and kindness again to help me out once more.
Here is an example of such a file name:

Actually it would be great to replace all underlines with dashes in the actual name of the files (ie: sender, receiver, subject of the emails)

20081106-0804-Jacques-André Schneider-Re_CPIC - Traduction allemande.eml

Once again, many thanks !
Oyle
 
Posts: 2
Joined: Mon Mar 09, 2015 9:16 pm


Return to BRU Support