Move text from one part of filename to another

Advanced Renamer forum
#1 : 26/05-21 05:42
Kyu Rhee
Kyu Rhee
Posts: 2
XXXXXX &&&&&&&&&&&&&& ####Kbps.qvn

XXXXXX: Fixed length
&&&&: Variable length
####: Variable length

Would love to rename a few thousand files to:

&&&&&&&&&&&&&& XXXXXX ####Kbps.qvn

Any suggestions? Thanks.


26/05-21 05:42
#2 : 26/05-21 19:15
David Lee
David Lee
Posts: 1125
If "XXXXXX" and "&&&&&&&&&&&&&&" never contain any spaces then:

Replace: ([^ ]* )([^ ]* )
with: \2\1
Use regular expressions

Or (using the length of "XXXXXX " = 7 characters):

Replace: (.{7})([^ ]* )
with: \2\1
Use regular expressions

Otherwise you will have to give more details about the possible structure of "&&&&&&&&&&&&&&"


26/05-21 19:15
#3 : 31/05-21 02:23
Kyu Rhee
Kyu Rhee
Posts: 2
Reply to #2:

Hi David

Yes, both "XXXXXX" and "&&&&&&&&&&&&&&" can contain spaces. Lengths are variable as well.

Liked your suggestion for files that do not have spaces in "XXXXXX".

Thoughts on "XXXXXX" with spaces?

"XXXXXX"


31/05-21 02:23
#4 : 31/05-21 08:45
David Lee
David Lee
Posts: 1125
Reply to #3:
It is impossible with the information that you have given so far! Unless there are some unique features of the three strings that allow us to determine their boundaries there is no way to separate them in general.

You originally stated that "XXXXXX" is fixed-length, which would allow us to extract that component. To separate "&&&&&&&&&&&&&&" and " ####" we need to identify unique features of the two strings. For example I assume that "####" is a data rate ("Kbps") in which case it is likely to be a number with a determinable range of digits or possibly even discrete possible values which may allow us to distinguish it from "&&&&&&&&&&&&&&".

Please provide some typical examples of filenames.


31/05-21 08:45