Name Swap

Advanced Renamer forum
#1 : 02/09-19 17:52
J Cradduck
J Cradduck
Posts: 1
If I want to swap 2 words in a long file name, how can I? As in swapping a last name and first name at the beginning of a file name but not disturbing the rest of the file name,


02/09-19 17:52
#2 : 03/09-19 09:16
David Lee
David Lee
Posts: 261
Assuming that the words are separated by spaces:

Use the Replace method
Replace: (\w+ )(\w+ )
with: \2\1
Occurrence: 1st
Use regular expressions

The regex (\w+ ) matches a string of one or more word characters followed by a space and saves it into a variable \1, \2 etc

If you have other separators then replace the spaces in the regex as appropriate.




03/09-19 09:16