Moving numbers from near the end of the file to the front

A swapping-ground for Regular Expression syntax

Moving numbers from near the end of the file to the front

Postby lordlance » Sun Aug 30, 2020 1:20 am

I downloaded a bunch of files from a YouTube channel using JDownloader. If you've used the application before, I am sure you know that the file names are appended with the format of the file.

For example: Bruckner Symphony No. 8 Karajan BPO 1978 (128kbit_AAC).m4a

I want to shift the year of the performance of all the works to the front. I face a situation wherein these are currently near the end of the file but their position is always variable so I can't use directly move characters of a file name from the end to the front. Neither can I use a simple number shift because all the AAC/OGG file mention their variable bit rates (as seen above with 128kbit.)

This is my entire folder:https://imgur.com/a/H4dLqDr

Is there a way to shift all the years from near the end to the front?
lordlance
 
Posts: 4
Joined: Sun Aug 30, 2020 1:14 am

Re: Moving numbers from near the end of the file to the front

Postby David » Sun Aug 30, 2020 2:37 am

try

Match:
(.*?).(\d\d\d\d)(.*)
Replace:
\2 \1\3
David
 
Posts: 6
Joined: Mon Jun 15, 2020 7:25 am

Re: Moving numbers from near the end of the file to the front

Postby lordlance » Sun Aug 30, 2020 3:49 am

David wrote:try

Match:
(.*?).(\d\d\d\d)(.*)
Replace:
\2 \1\3


I can't thank you enough. Thank you so much!
lordlance
 
Posts: 4
Joined: Sun Aug 30, 2020 1:14 am

Re: Moving numbers from near the end of the file to the front

Postby lordlance » Mon Aug 31, 2020 11:16 am

David wrote:try

Match:
(.*?).(\d\d\d\d)(.*)
Replace:
\2 \1\3


I was wondering if there was a way to shift the year of the performance from the start of the file name to after the work's name?

It's usually going to be before 'VPO', 'BPO', 'Karajan' or the soloist's name.
lordlance
 
Posts: 4
Joined: Sun Aug 30, 2020 1:14 am

Re: Moving numbers from near the end of the file to the front

Postby David » Tue Sep 01, 2020 4:09 am

lordlance wrote:
David wrote:try

Match:
(.*?).(\d\d\d\d)(.*)
Replace:
\2 \1\3


I was wondering if there was a way to shift the year of the performance from the start of the file name to after the work's name?

It's usually going to be before 'VPO', 'BPO', 'Karajan' or the soloist's name.


try

Match:
^(\d\d\d\d).(.*?)(Karajan|VPO|BPO)(.*)
Replace:
\2\1 \3\4

you can add more soloist's name
David
 
Posts: 6
Joined: Mon Jun 15, 2020 7:25 am

Re: Moving numbers from near the end of the file to the front

Postby lordlance » Sat Sep 05, 2020 7:41 am

David wrote:
lordlance wrote:
David wrote:try

Match:
(.*?).(\d\d\d\d)(.*)
Replace:
\2 \1\3


I was wondering if there was a way to shift the year of the performance from the start of the file name to after the work's name?

It's usually going to be before 'VPO', 'BPO', 'Karajan' or the soloist's name.


try

Match:
^(\d\d\d\d).(.*?)(Karajan|VPO|BPO)(.*)
Replace:
\2\1 \3\4

you can add more soloist's name


Thanks. I appreciate it.
lordlance
 
Posts: 4
Joined: Sun Aug 30, 2020 1:14 am


Return to Regular Expressions