Moving Interior Characters

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

Moving Interior Characters

Postby wryterjccc » Mon May 03, 2021 5:20 pm

I have a bunch of files where where interior characters (at the same position) need to be moved to a different position. For example, I want many files that are named something like:

Father #005 560822 Name.mp3

Changed to

Father 560822 #005 Name.mp3

Thanks for any help you can offer.

John
wryterjccc
 
Posts: 4
Joined: Mon May 03, 2021 4:47 pm

Re: Moving Interior Characters

Postby Luuk » Mon May 03, 2021 7:12 pm

With RegEx(1) the Match and Replace can be like...
(.+)( #\d+)( \d+)( .+)
\1\3\2\4
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Moving Interior Characters

Postby wryterjccc » Wed May 05, 2021 6:36 pm

Thanks. It works great. I still have some research to do to understand the Regex, but at least m learning.
John
wryterjccc
 
Posts: 4
Joined: Mon May 03, 2021 4:47 pm

Re: Moving Interior Characters

Postby therube » Wed May 05, 2021 7:52 pm

If the file names are "named" similarly, like with 4 "fields", separated by a space, you can do something like:

1:RegEx: (enable, Simple)
Code: Select all
Match:    %1 %2 %3 %4
Replace:  %1 %3 %2 %4
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Moving Interior Characters

Postby Admin » Thu May 06, 2021 12:40 am

Some info on Simple Regex

SIMPLE REGULAR EXPRESSIONS

Bulk Rename Utility 3.4 introduces Simple Regular Expressions, which can be enabled by switching on the option Simple in group RegEx (1).

Simple regular expressions work by matching text and then removing or rearranging the matched text.

The syntax is very simple, up to 9 matching tags can be used %1, %2, %3 until %9, which match a string of text. Examples:

Match: %1-%2
Replace: %2-%1

It will match first a string of text with %1 then the character '-' and then another string of text. It will then replace it with the second string of matched text, the character '-' and the first string of text matched. Effectively it will switch text around the character '-'.

Match: %1(%2)
Replace: %2

It will match first a string of text with %1 then a '(' and then another string of text followed by ')'. It will then replace it with the second string of matched text and the rest is dropped.

Match: %1-%2-%3 %4
Replace: %3-%2-%1 %4

It will match and reorder text such as '2020-03-12 Boston' into '12-03-2020 Boston'.

Match: %1%2%3%4
Replace: ABC%4

Replaces the first 3 characters with 'ABC'.

Up to 9 matching tags can be used : %1, %2, %3 until %9.
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support