Page 1 of 1

Convert multiple file dates

PostPosted: Mon Mar 22, 2021 12:34 pm
by BIGZIPZ
Hello.

I have lots of files named with written dates for example:

Apr_1__1925_
Jun_5__1926_
Aug_10__1927_

Is there a way for me to use this program to scan the whole directory of them and change them to:

1925-04-01
1926-06-05
1927-08-10

Thank you.

Convert Month Abbreviations into Numbers, then Rearrange Dat

PostPosted: Mon Mar 22, 2021 5:41 pm
by Luuk
The RegEx(1) does this with a checkmark in "v2", and then a "multiple" Match and Replace like...
Jan_(?X)Feb_(?X)Mar_(?X)Apr_(?X)Mai_(?X)Jun_(?X)Jul_(?X)Aug_(?X)Sep_(?X)Okt_(?X)Nov_(?X)Dez_(?X)__(\d)__(?X)(\d\d)_+(\d\d)_+(\d{4})_
01__(?X)02__(?X)03__(?X)04__(?X)05__(?X)06__(?X)07_(?X)08__(?X)09__(?X)10__(?X)11__(?X)12__(?X)__0$1___(?X)\3-\1-\2

Each (?X) separates another Match/Replace. The Replace uses extra underscores just to line up better for the eyesight, then _+ fixes them away.
This to let other users better understand for modifying, like if someone had names with '__1__AnyDate_', then its much better to use...
Jan_(?X)Feb_(?X)Mar_(?X)Apr_(?X)Mai_(?X)Jun_(?X)Jul_(?X)Aug_(?X)Sep_(?X)Okt_(?X)Nov_(?X)Dez_(?X)(\d\d)__(\d)__(\d{4})_(?X)(\d\d)_+(\d\d)_+(\d{4})_
01__(?X)02__(?X)03__(?X)04__(?X)05__(?X)06__(?X)07_(?X)08__(?X)09__(?X)10__(?X)11__(?X)12__(?X)$1_____0$2______$3_(?X)\3-\1-\2

Also, if there can be many dates in one filename, then each Match part needs /g at the end, to fix them all at the same time.
Or you could just keep clicking rename, and then refreshing, to fix them one date at a time.

Re: Convert multiple file dates

PostPosted: Mon Mar 22, 2021 6:35 pm
by BIGZIPZ
Thank you sir, worked flawlessly

Re: Convert multiple file dates

PostPosted: Tue Mar 23, 2021 12:04 am
by Admin
8)