File renaming

Advanced Renamer forum
#1 : 10/11-19 17:40
kurt
kurt
Posts: 8
Dear all,

Could you please help me to solve the following problem:

Filename original --> Filename needed
xy E123 --> E123 - xy
abc E456 --> E456 - abc

it should work, regardless of the length of the filename.

Kind regards,

Kurt


10/11-19 17:40 - edited 10/11-19 17:43
#2 : 10/11-19 18:53
David Lee
David Lee
Posts: 1125
Replace: (.*) (.*)
with: \2 - \1
Use regular expressions


10/11-19 18:53
#3 : 10/11-19 19:10
kurt
kurt
Posts: 8
Reply to #2:
Thank you for your quick response, but I think I didn't write it clear enough:

Alina Schallers Bewerbung für die SO...ko Donau E436.mp4 --> E436 - Alina Schallers Bewerbung für die SO...ko Donau.mp4

2nd example:

„Welche Farbe hat der Feuerlöscher“ E429.webm --> E429 - „Welche Farbe hat der Feuerlöscher“.webm

I hope this is more clear.

Kind regards,

Kurt


10/11-19 19:10
#4 : 11/11-19 10:07
David Lee
David Lee
Posts: 1125
Reply to #3:
Use regex: (.*) (.*)$


11/11-19 10:07
#5 : 11/11-19 11:35
kurt
kurt
Posts: 8
Reply to #4:
Dear all,
Thanks for reply (maybe to David), but I'm so silly.

Could you lead me (Step-by-Step)?

I know what you mean - Use regex, but which function is needed for ? Shift, change, ....

Best would be an example screen-shot.

If it's better to mail a screenshot, my mail address is '[email protected]'.

Kind regards

Kurt


11/11-19 11:35
#6 : 11/11-19 14:38
David Lee
David Lee
Posts: 1125
Reply to #5:
I assumed from your previous reply that you understood my first suggestion and have a basic understanding of Advanced Renamer.

Use the Replace method...

Text to be replaced: (.*) (.*)$
Replace with: \2 - \1
Use regular expressions: √

Explanation...

".*" matches a string of any number of characters and enclosing it in parentheses indicates that the match should be saved for later use, as a "subpattern" (\n).

Hence: "(.*) (.*)" will match two strings of any characters (including spaces) separated by a single space, with the two strings saved as \1 and \2

Your second post indicates that your filenames can contain more than one space but the above regular expression will divide at the first one. Appending $ - the end-of-line character - ensures that the filename is divided by the final space - ie the second subpattern must be preceded by a space and followed by the end of the filename.

Finally, the "Replace with: string - "\2 - \1" - reverses the order of the two subpatterns, separated by " - " as you requested.

You should read through all the material in the User Guide to fully understand how this application works: www.advancedrenamer.com/user_guide/gettingstarted


11/11-19 14:38 - edited 11/11-19 14:40
#7 : 11/11-19 15:43
kurt
kurt
Posts: 8
Reply to #6:
A last Thanks to you; I did it like you told me - and it worked fine!!

Kind regards

Kurt


11/11-19 15:43