Rearrange filename

Bulk Rename Utility How-To's

Rearrange filename

Postby Magtiel » Thu Nov 11, 2021 11:12 am

I have file names with this pattern:
FIRSTNAME MIDLENAME LASTNAME1 LASTNAME2 ECOGRAFÍA WORD1 WORD2 WORD3…..pdf

Before the word ECOGRAFÍA I can have from 2 to 4 words and after several words.
What I need to do is rearrange the name and put ECOGRAFÍA and all the words after that at the beginning of the filename and the names after:

Ex.
ECOGRAFÍA WORD1 WORD2 WORD3 NAME1 NAME2 LASTNAME1 LASTNAME2.pdf.

I found an exempel here:
Match:
([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)

Replace
\4 \5 \6 \1 \2 \3

It works but in that case I need to organize files and modify the syntax for each group.
I suppose it has to be a better way to do that?
Thanks in advance!
MJ
Magtiel
 
Posts: 2
Joined: Thu Nov 11, 2021 10:30 am

Re: Rearrange filename

Postby Admin » Fri Nov 12, 2021 3:01 am

Try this :

RegEx (1)

Enable -> Simple

Match: %1 ECOGRAFÍA %2
Replace: ECOGRAFÍA %2 %1

Does that work?
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rearrange filename

Postby Magtiel » Fri Nov 12, 2021 9:04 am

Yes, it works!
!hank you so much!
Magtiel
 
Posts: 2
Joined: Thu Nov 11, 2021 10:30 am


Return to How-To