Date inversion method Day/Month/Year?

Advanced Renamer forum
#1 : 31/03-24 13:33
Adaline Bowman
Adaline Bowman
Posts: 3
Good morning,
For years, I named photo and other files with the French date format:
Day month Year.
Example: 01/31/2024 for January 31, 2024

Is it possible to create a method so that the format becomes Year/Month/Day.
Example: 2024.01.31

Thanks for your help.


31/03-24 13:33
#2 : 31/03-24 15:55
Delta Foxtrot
Delta Foxtrot
Posts: 106
Reply to #1:

Hi Adaline,

Couldn't be easier. One replace method. There could be complications, depending on what other numbers /delimiters are there. could complicate matters. Does the date fall at start or end of filename? Are there delimiters that you use in every filename that separates the date from the rest of the filename? If there are delimiters, are they unique to the boundaries of the date?

Chances are, though that this:
----------
Replace: (\d\d)\.(\d\d)\.(\d\d\d\d)

Replace with: $3.$2.$1

Regular expressions: YES
----------
will do it for you. Be sure not to put in any spaces.

The "\d" in Regex-ese denotes one number (0-9). the \. denotes one period. Each parenthesis pair () is just a container that can be referenced in the replacement part. As you can see, we are taking the first container and putting it in position 3, the second in two, the third in position one. The backslashes are special characters used to change, or "escape," the meaning of other characters. In this case, without the escape a "d" is just a d; wheres a "." is a special character in Regex meaning "match ANY one and only one character. The backslash escape tells the regex parser to treat it as just a regular period.

We reference the containers (in the replace part) with either "$" or "\" backslash.

I respectfully suggest that if you are going to be using Advanced Renamer for more extensive renames, that you read a little about Regex. It's really not that tough once that first lightbulb clicks on in your head. :) The user manual here on this website is a good place to start; it will give you a grounding that will cover maybe 95 percent of your regex renaming needs.

(BTW, if you get wonky results in the preview "New filename" column, just clear the list and come back. Bring some sample filenames. :)

Cheers!
DF


31/03-24 15:55 - edited 31/03-24 15:58
#3 : 31/03-24 18:29
Adaline Bowman
Adaline Bowman
Posts: 3
Reply to #2:
Good morning,
Thank you for this long, very detailed answer, but I'm sorry, I don't understand much and the English>French translation from Google translate doesn't help matters..

Currently my files look exactly like this:

Day.month.year - Blood results
30.11.2023 - Blood results


I would like exactly that with Advancedrenamer:

Year.month.day - Blood results
2023.11.30 - Blood results

Thanks for your help.


31/03-24 18:29
#4 : 31/03-24 19:45
Miguel
Miguel
Posts: 60
Reply to #3:
It´s good give a real example of what we have and what we want. This would be a norm in the forum.

Following your example, as DF said you can use regex for this.
Method REPLACE:
Tex to be REPLACE: (\d\d).(\d\d).(\d{4})
REPLACE with: $3.$2.$1
Use Regular expressions marked

https://i.ibb.co/5FDqDyV/Captura-31-03-2024-04s. png


31/03-24 19:45
#5 : 31/03-24 20:10
Delta Foxtrot
Delta Foxtrot
Posts: 106
Reply to #3:

Sorry Adaline, your profile didn't mention a country and your (Google's) English was good, so...
I didn't notice the "French date format".
I'll know next time!
:)


Désolé Adaline, ton profil ne mentionnait pas de pays et ton anglais (de Google) était bon, alors...
Je n'ai pas remarqué le 'format de date français'.
Je le saurai la prochaine fois !
:)
(Merci Google)

Best,
DF


31/03-24 20:10
#6 : 11/04-24 22:31
Adaline Bowman
Adaline Bowman
Posts: 3
Reply to #5:
Good morning,
Sorry for the lack of responsiveness, I'm running out of time.
Thank you for your help, it works very well, it's perfect!
Can you tell me how to make a duplicate from the beginning of the file name to the end?

Original file name:
2023.11.30 - Blood results

End result I would like:
2023.11.30 - Blood results - 2023.11.30

Another question, if I understood correctly, you develop the regular expression using the site https://regex101.com/ and then you use the "advancedrenamer" software to use it?
Thanks for your help.


11/04-24 22:31
#7 : 11/04-24 23:29
Delta Foxtrot
Delta Foxtrot
Posts: 106
Reply to #6:

Bonjour Adaline :)

Use a REPLACE method:
---------
Text to be replaced: ^(.*) \- (.*)$

Replace with: $1 - $2 - $1

Occurrence: All or 1st
Use regular expressions: YES
Apply to: Name
---------
Screenshot: https://drive.google.com/file/d/1J4Jd2n3Nu31Vetq Tqzpmv4_XArPgWXf5/view?usp=sharing

As to your other question, first read the USER MANUAL on Regular Expressions:
https://www.advancedrenamer.com/user_guide/regul ar_expresions
It covers 95% of typical usage. Pay particular attention to parentheses and brackets "[ ]". They do a lot of the work.

From there, any reference on regular expressions should be helpful, but may include expressions that may not work in Advanced Renamer.

Best,
DF


11/04-24 23:29 - edited 11/04-24 23:34