Rename "replace text" question

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Rename "replace text" question Fri Jun 19, 2015 4:33 am • by fidosg
Hi
I am wondering how you use the (...) anything pattern with the replace function when renaming files.
So I am matching my name and my partners names using:
If Any
Contents contain match person (where person is token containing text "name-a")
Contents contain match person (where person is token containing text "name-b")
Contents contain match person (where person is token containing text "name-a (...) anything name-b")

Then renaming the files using
Rename with pattern > Date person extension
and then using Replace Text to replace the text within person with initials:
replace name-a with -na
replace name-b with -nb
replace nama-a (...) name-b with -na nb

the problem is I don't know how to express the (...) anything in the replace box...

Can anyone help?
thanks
fidosg
 
Posts: 9
Joined: Sun Jun 03, 2007 2:17 am

Re: Rename "replace text" question Fri Jun 19, 2015 11:22 am • by Mr_Noodle
The replace text function is for replacing straight text. There's no notion of patterns there. Instead, you want to structure your attributes to capture the right text and then omit everything else in the rename pattern. In your case, you want to have two attributes, one matching name-a and the other name-b but do not capture the text in-between. Then in the replace pattern, use the a & b attributes, which on longer have the intervening text.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rename "replace text" question Fri Jun 19, 2015 9:57 pm • by fidosg
Right - I get it, I need 2 tokens - one for name-a and one for name-b.... then I can order them:
If Any
Contents contain match "name-a (...) name-b") <- put this one first to ensure it captures fies with both names first
Contents contain match "name-a"
Contents contain match "name-b"

Then renaming the files using
Rename with pattern > Date name-a name-b extension
and then using Replace Text to replace the text within person with initials:
replace name-a with -na
replace name-b with -nb

THAT WORKED - THANKS
fidosg
 
Posts: 9
Joined: Sun Jun 03, 2007 2:17 am


Return to Support