renaming based on filename date

Advanced Renamer forum
#1 : 01/04-23 20:08
Adam
Adam
Posts: 3
I currently have files with the filenames such as: "June 1, 2020", "December 10, 2010" etc.

I want to rename it to: "2020-06-01", "2010-12-10"

is there any way to do this? I can't see a way in the software when I'm trying.


I cannot base it on creation date, modified date etc, it must be based on the existing file name


01/04-23 20:08 - edited 01/04-23 20:09
#2 : 01/04-23 23:46
David Lee
David Lee
Posts: 1125
Use three methods:

1) Replace method - to rearrange in order year-month-day...

Replace: ^(\w*) (\d+), (\d+)
with: \3-\1-\2
Use regular expressions

2) List replace method - to replace month names with numbers...

Add 12 lines - one for each month:

Replace: January with: 01
...
Replace: June with: 06
...
Replace: December with: 12

3) Renumber method - to fix zero-padding of single-digit days...

Number position: 3
Change to: Relative to existing number
Zero Padding: Manual
Number length: 2



01/04-23 23:46
#4 : 18/05-23 15:09
Darion
Darion
Posts: 1
Reply to #1:
Create a new folder: Create a new folder where you will move renamed files. This will help avoid losing or confusing files.
Open a command line (Windows) or a terminal (Mac/Linux): To do this, go to "Start" (Windows) or "Applications" (Mac/Linux) menu and look for "Command Line" (Windows) or "Terminal" (Mac/Linux).
Navigate to the directory with the files: Use the cd command to navigate to the directory where the files you want to rename are located. For example, if the files are on your desktop, you could type cd Desktop (Windows) or cd ~/Desktop (Mac/Linux) to go to your desktop.
Use the rename command: At the command line (Windows) or terminal (Mac/Linux), type the following command to rename files:
ren "old_name" "new_name"
Here "old_name" should be the original file name and "new_name" should be the desired name you want to give the file. Don't forget to put file names in quotes, especially if they contain spaces or special characters.
Repeat step 4 for each file: Repeat the rename command for each file you want to rename. For example:
ren "June 1, 2020." "2020-06-01"
ren "December 10, 2010." "2010-12-10"
Note that commands may be slightly different depending on the operating system.


18/05-23 15:09