Page 1 of 1

cannot find the solution - change date format

PostPosted: Sun Jan 19, 2020 4:10 pm
by DutchFlyingMike
I managed to remove underscores and some words, but the next step i cannot solve.
I have several files from a podcast program. During the last years they changed the filenames.
I now have a list with

De Sandwich 19-05-2019.mp3
De Sandwich 20-10-2019.mp3
etc.

I like to change the filenames in
2019-05-19 De Sandwich.mp3
2019-10-20 De Sandwich.mp3

Can someone explain, maybe with screenshots, how to fix this problem?

Thx for helping

Re: cannot find the solution

PostPosted: Sun Jan 19, 2020 4:57 pm
by therube
Assuming your files end in (space) day-mon-year...

1:Regex
Code: Select all
Match:  (.*)\s(\d\d)-(\d\d)-(\d\d\d\d)
Replace:  \4-\3-\2 \1

match everything up to the date
match the day
match the month
match the year

rearrange to: year-mon-day everythingelse

Re: cannot find the solution - change date format

PostPosted: Tue Jan 21, 2020 12:24 pm
by DutchFlyingMike
Thanks, it worked!
This was too difficult for me.
Gr.
Mike

Re: cannot find the solution - change date format

PostPosted: Tue Jan 21, 2020 5:14 pm
by DutchFlyingMike
Hello therube,

Hopefully you want to help me again.
I tried to understand which commands you used, but still have problems.

Another part of my files is as followed: 01-01-2017 De Sandwich.mp3
01-10-2017 De Sandwich.mp3 (date D/M/Y)
I would like to have it as: 2017-01-01 De Sandwich.mp3
2017-10-01 De Sandwich.mp3 (date Y/M/D)

Thx in advance,
Mike

Re: cannot find the solution - change date format

PostPosted: Thu Jan 23, 2020 3:58 am
by therube
Code: Select all
Match:  (\d\d)-(\d\d)-(\d\d\d\d)(.*)
Replace:  \3-\2-\1\4


Original, (date D/M/Y).
Code: Select all
D = \1
M = \2
Y = \3

The \# are positional fields (based on the parenthesis in your Match:).

Just rearrange as you want, Y-M-D = \3-\2-\1.
And M-Y-D = \2-\3-\1.

Re: cannot find the solution - change date format

PostPosted: Fri Jan 24, 2020 9:24 am
by DutchFlyingMike
Hello therube,

Thx for helping me.
Now i understand how it works.
My list is organized now. The duplicates are removed.
I'm very happy now.
Problem solved.

Gr
Mike