Change Sequence

Advanced Renamer forum
#1 : 01/07-11 20:07
Art
Art
Posts: 7
I am new your software, but it looks professionally executed. Thanks

Is there a way to change the sequence of a file name, such as:

Change a file name from "Feist, Raymond E. - A Kingdom Besieged.txt” to “Raymond E. Feist- A Kingdom Besieged.txt” (no quotation marks)

Some files will be in a format of “Feist, Raymond - A Kingdom Besieged.txt” i.e., w/o middle initials.

Many Thanks


01/07-11 20:07
#2 : 02/07-11 11:00
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #1:
Yes, there is a way. But you need to use the latest beta. Download the beta from the download page and do the following.

1. Add the files.
2. Clear all methods.
3. Add a replace method and configure it like this:
Test to be replaced: " -" (without the quotes).
Replace with: ", <Word:1> -" without the quotes
Clear checkboxes and set ApplyTo to Name.
4. Add another replace method and configure it like this:
Test to be replaced: "<Word:1>, " (without the quotes).
Leave Replace with blank
Clear checkboxes and set ApplyTo to Name.
5. Verify the new names in the New Name column.

What we have done here is to move the first word to the location before the -. If the file names have different patterns, like _ instead og spaces, another solution needs to be applied to those files.


02/07-11 11:00
#3 : 02/07-11 13:25
Art
Art
Posts: 7
Reply to #2:
Many thanks. Great help.

Another challenge plse...

How does one change the sequence of:

"The Man in the Iron Mask - Alexandre Dumas.txt" (no quotes)

to:

"Alexandre Dumas.txt" - The Man in the Iron Mask" (no quotes)

Art


02/07-11 13:25
#4 : 02/07-11 13:59
Art
Art
Posts: 7
Reply to #3:
Small correction ...

Looking to replace the syntax of :

"The Man in the Iron Mask - Alexandre Dumas.txt" (no quotes)

to:

"Alexandre Dumas" - The Man in the Iron Mask.txt" (no quotes)

Art


02/07-11 13:59
#5 : 04/07-11 08:47
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #4:
The easiest way is to use a regular expressions replace. Regular expressions can seem rather magical but I will walk you through a simple expression.

1. Add the files
2. Clear the method list
3. Add Replace Method
4. Configure it like this:
Text to be replaced: "(.*) - (.*)" without the quotes
Replace with: "\2 - \1" without the quotes
Case sensitive: no
Regular expressions: yes
Apply to: Name
5. Verify new names and hit Start Batch

What it does is:
(.*) - (.*) is a pattern. Dot . means any character and star * means any number of repetition of the previous character. DotStar .* will match any sequence characters. In the pattern I have made two groups of patterns divided by " - ". The paranthesis is a grouping. This means that the first group (.*) will have the number \1 and the second (.*) will have the number \2.
The first (.*) will match "The Man in the Iron Mask" and get the number \1.
The second (.*) will match "Alexandre Dumas" and get the number \2.
In the Replace With text box we replace the complete pattern with a pattern where we have switched the two subpatterns around.

If you don't understand my explanation of this regular expression it is not because you are stupid. These expressions are meant for advanced users. But once you learn how to use them, they become very powerful.
You can also do the switch by a combination of the other methods but it can be more difficult to set up the correct sequence of methods.


04/07-11 08:47
#6 : 04/07-11 17:14
Art
Art
Posts: 7
Reply to #5:
Magical does not even start describing the effect... You have saved me many hours...

Made a small donation to this great site.

How do I save this as a new expression plse?

Sincere thanks, Art


04/07-11 17:14 - edited 04/07-11 17:41
#7 : 04/07-11 20:46
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #6:
Above the list of methods there is a line that says "Presets" with a dropdown box and a open button and a save button. Click the save button to save the method list. Use the open button to load the list again.

Thank you for the donation :-).


04/07-11 20:46 - edited 04/07-11 21:00
#8 : 14/08-11 20:21
Art
Art
Posts: 7
Reply to #7:
One more please...

Trying to change the sequence of First & Last names, from Johnson, Abe – Once Upon a Time.txt to Abe Johnson – Once Upon a Time.txt (NO , )using the “Advanced Renamer” Can you plse send a batch file?

Many thanks



14/08-11 20:21
#9 : 16/08-11 21:34
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #8:
Please try this batch file:
http://www.advancedrenamer.com/down/forum/name_ switch.aren

The batch file use regular expressions which can be pretty advanced but also very powerful. What it does it that it divides the filename into 3 parts divided by , and -. After that the first and the second part is switched.


16/08-11 21:34
#10 : 20/08-11 17:06
Art
Art
Posts: 7
Reply to #9:
Thank you. It works well - other than in cases where numbers are involved, but I can work around it.

Since we are communicating - how do I change a simpler sequence, such as:

Lackey, Mercedes to Mercedes Lackey (losing the comma)?

There might be variations - such as:

Lackey, Mercedes A - which I would like to change to Mercedes A. Lackey (losing the comma)?

Good day


20/08-11 17:06