fixing date and keeping the rest of the text intact

Advanced Renamer forum
#1 : 13/04-20 15:20
Ceyhun
Ceyhun
Posts: 5
Hello I'd like to change the file names to sort by date easily while keeping the text at the end as is.

Example:
April_9,_2020
March_8,_2017
January_7,_2018 - hello world how are you

To:
20.04.09
17.03.08
18.01.07 - hello world how are you

Currently, I use swap, list replace, renumber and remove but the "- hello world how are you" part is mixing up the whole thing. How can I keep anything that comes after the DD e.g "09,08,07" whether there is a space, "-" or anything to just stay the way it is so that when I give append to the title of my documents after the year YYYY say "2020abc" or "2020 abc" or "2020.abc" or "2020 - abc" etc... whatever I write after the year will remain the same.

Thank you

Thank you


13/04-20 15:20
#2 : 13/04-20 16:28
David Lee
David Lee
Posts: 1125
You can do it in 3 steps:

1) List replace - to convert text months to numeric...
January -> 01 etc

2) Renumber - to zero-pad the days...
Number position: 2
Change to: Relative to existing number
Zero padding: manual
Number length: 2

3) Replace - to reorder the date and change the separators...
Text to be replaced: (\d{2})_(\d{2}),_20(\d{2})
Replace with: \3.\1.\2
Use regular expressions

Everything following the original date will be retained.


13/04-20 16:28
#3 : 13/04-20 18:00
Ceyhun
Ceyhun
Posts: 5
Reply to #2:

Perfect it worked! Thank you so much, David

just one thing, if the year in the title is 1988, it doesn't work, just out of curiosity, how can I edit your expression so that it will crop the first 2 digits and only show 88?

Also, what does turning on "regular expressions" do?

and the occurrence should be "all"? what does it do?

I've just discovered this program and it delivers such a powerful functionality, at which tasks does this program shine so that I can keep in mind?

P.S: this program reminded me of another amazingly functional software I was using back then "GoodSync" maybe you've heard of it :)

Thank you again :)


13/04-20 18:00 - edited 13/04-20 18:02
#4 : 13/04-20 23:54
David Lee
David Lee
Posts: 1125
Reply to #3:
Change "Text to be replaced" to: (\d{2})_(\d{2}),_\d{2}(\d{2})

With Regular expressions deselected, renaming methods work with ordinary text strings. Regular expressions use meta-characters with special meanings in order to perform advanced pattern searching and replacements. For example \d{2} searches for two consecutive digits in the filename. If the search element is enclosed in parentheses - (\d{2}) - then the match is saved in a variable such as \1. See the user Guide for an introduction: www.advancedrenamer.com/user_guide/regular_expresions

If there are multiple possible matches in the filename then "Occurrence" will define which one to replace or replace all matches. In this case there is only one possible match, so Occurrence can be set to either All or 1



13/04-20 23:54 - edited 14/04-20 00:08
#5 : 16/04-20 06:32
Ceyhun
Ceyhun
Posts: 5
Reply to #4:

Thank you it worked. man this dropbox paper now just changed the export file naming rule. now the file name "April 14, 2020 - hello world how are you" became "April_14,_2020_-_hello_world_how_are_you" after export. I added replace and replaced "_" with " " so the problem resolved. but is there a future proof way that you could tweak your first 4 digit year formula (I liked that one more) so that anything Dropbox changes with its export file naming, I would always end up with "YYYY.MM.DDwhatever" "whatever" could be anything, either "_____dsfsdfs" or ".sdfds.dsfds" or" - dsfds -dsfds) so after DD anything will be the same as I wrote in the title as I created the document regardless of how dropbox can screw that up in the export by filling the blanks with extra stuff...

Thank you


16/04-20 06:32
#6 : 30/04-20 05:41
Ceyhun
Ceyhun
Posts: 5
Reply to #5:
Hello David I couldn't hear from you, are you going to respond?

I'd like to thank you for your previous responses, they have been really helpful..


30/04-20 05:41