Change a string. wild cards?

Post any Bulk Rename Command support requirements here. Open to all registered users.

Change a string. wild cards?

Postby dec » Mon Jun 26, 2023 4:05 pm

i have a time string in a file name with current format '(0434min)' (w/o the quotes)

what is missing is the separator - which needs to be '-' (: has a syntax issue)

so how do i search for '??min' and replace with '-??min'?
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am

Re: Change a string. wild cards?

Postby therube » Tue Jun 27, 2023 6:20 pm

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

(This assumes that there is a <space> before the opening set of digits.)


I believe that should do it.
Give it a run & make sure.
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Change a string. wild cards?

Postby dec » Fri Jun 30, 2023 3:30 am

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

(This assumes that there is a <space> before the opening set of digits.)


I believe that should do it.
Give it a run & make sure.


dear friend

it didn't work. :-(

pls see attachment and see if i make mistake.

attachment alos shows an example record

whoops. this bloody site does not allow uploading screenshot. which is just pathetic and useless.

ok. i worked out that i can do a C&P of file name if i use file rename ...

Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (0416min) (AID) (NORM)

here is the code which is just a copy of what you have above

(.*?)\s(\d\d)(\d\d)min(.*)

\1 \2-\3min\4

btw, i tried with v2 and simple and both ... made no difference

kind regards



kind regards
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am

Re: Change a string. wild cards?

Postby therube » Fri Jun 30, 2023 4:54 pm

Try this one.

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


Code: Select all
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (0416min) (AID) (NORM).m4a ->
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (04-16min) (AID) (NORM).m4a
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Change a string. wild cards?

Postby dec » Sun Jul 02, 2023 10:29 pm

therube wrote:Try this one.

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


Code: Select all
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (0416min) (AID) (NORM).m4a ->
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (04-16min) (AID) (NORM).m4a


thanks so much. will give a try.

sorry for any delay.
at the moment the issues with a number of related apps (think - MP3Tag, AIMP+Editor, Picard, TagScanner, ALLDup, dupeGuru) i am dealing with is making be dizzy and confused just wher anything is
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am

Re: Change a string. wild cards?

Postby dec » Sun Jul 02, 2023 10:34 pm

therube wrote:Try this one.

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


Code: Select all
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (0416min) (AID) (NORM).m4a ->
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (04-16min) (AID) (NORM).m4a


works like a charm, bro!

i will have to save that somewhere

the reason i neeed this, about from any name chage errors, is that MP3Tag has an 'inconsistent' may of formatting Length/Duration which gives rise to this unformatted format;-)

ok. i am off to try to identify the relevant files (that is another issue - there is no way i can think of to identify tracks/records with that Length 'format' '(nnnn)' in the file name string
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am

Re: Change a string. wild cards?

Postby dec » Sun Jul 02, 2023 10:46 pm

therube wrote:Try this one.

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


Code: Select all
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (0416min) (AID) (NORM).m4a ->
Aaron Neville & The Neville Brothers - Tell It Like It Is (The Big Easy) (1987) (256kbits) (04-16min) (AID) (NORM).m4a


ha. what i just discovered is that your fix is so clever is that it goes NOT change names that already have that format!

ok bad news is that i have recently decided to make all Length fields have an '_' separator - NOT a '-' separator - mainly so that it does not get confused with all the other '-' use in file name, espec between artist and title (track name)

now i think in your great fix, if i just replace the existing '-' with '_' that will do it, as intended, for existing file names without any current separators

but, which is the reason i want to do this, how do i change all the existing file name from '-' to '_'? a global replace of course won't work because of all the other '-' used

a simple fix would be to modify your fix so that it actually works on ALL names, so that where '-' exists already, we end up with '-_' - which i can then easily fix with a global replace

thoughts? :-)
dec
 
Posts: 67
Joined: Thu Oct 14, 2021 6:31 am


Return to BRC Support