How to Retain Certain Terms in a Filename

Post any Bulk Rename Utility support requirements here. Open to all registered users.

How to Retain Certain Terms in a Filename

Postby johnswirt » Sat Sep 29, 2012 2:46 am

I am trying to use this program as a bates stamp for e-document production in a lawsuit. I have thousands of e-mail and pdf files that need to be renamed. For example, take three files with the following names:

Ticket Audit CONFIDENTIAL.pdf
Dubbing invoice.msg
1120s 2011 Federal Tax return HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY.pdf

I want to rename them so they come out as follows:

CONFIDENTIAL Plaintiff Production 0000000001.pdf
Plaintiff Production 0000000002.msg
HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY Plaintiff Production 0000000003.pdf

I can accomplish this by first searching for the terms "CONFIDENTIAL" and "HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY" and moving those files to create 3 separate folders and have figured out how to rename the files, but I was wondering if there was a way to retain certain terms if they are present in a filename and in those instances, move the retained terms from the end of the filename where they are now to the beginning as shown in the example.

Any assistance would be greatly appreciated. I would also appreciate if you could send me a e-mail to johnswirt@yahoo.com if you are able to answer this questions so I know that an answer has been posted.

Thank you and this program is really great!
johnswirt
 
Posts: 2
Joined: Sat Sep 29, 2012 2:22 am

Re: How to Retain Certain Terms in a Filename

Postby Stefan » Sat Sep 29, 2012 11:34 am

One way would be

Selections(12)[ *CONFIDENTIAL.*]
Click into the file list to update the view, you should see only files with CONFIDENTIAL at the end

or
Selections(12)[ *HIGHLY*CONFIDENTIAL*ATTORNEYS*EYES*ONLY.*] for that matter.


Others can try this in the BRU folder with
Selections(12)[ *Utility*]



Now use
Repl.(3)
Replace: " Utility"
With:

AND
Add(7)
Prefix: "Utility "


(Remember to select the files in the list first to see an effect!)

- - -


An second way in one step would be

RegEx(1)
Match: "(.*) (Utility)"
Repla: "\2 \1"

or e.g.

RegEx(1)
Match: "(.*) (HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY)"
Repla: "\2 \1"




HTH? :D
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How to Retain Certain Terms in a Filename

Postby johnswirt » Sat Sep 29, 2012 4:09 pm

Thank you Stefan. I was able to get the first "Selections (12)" method you suggested to work, but I was not able to do the second method using RegEx (1) for some reason. I just started using this yesterday so it is quite new to me but I can see that there are a lot of cool things that can be done with it, like renaming photo files, documents in a particular folder, etc.

It would appear though, based on your response, that in either case, because I have two distinct terms that I want to retain, that I will have to run the BRU on the folder three times, first to rename the files with neither "CONFIDENTIAL" nor "HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY", and once again for each term. Am I correct about this?
johnswirt
 
Posts: 2
Joined: Sat Sep 29, 2012 2:22 am

Re: How to Retain Certain Terms in a Filename

Postby Stefan » Sun Sep 30, 2012 10:21 am

johnswirt wrote: but I was not able to do the second method using RegEx (1) for some reason.

You know you don't have to use the quotes "..." itself while trying this with BRU?
They are normally only there to clarify the start and end of the string/pattern/expression to use!


johnswirt wrote:It would appear though, based on your response, that in either case, because I have two distinct terms that I want to retain,
that I will have to run the BRU on the folder three times, first to rename the files with neither "CONFIDENTIAL"
nor "HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY", and once again for each term. Am I correct about this?

Yes, right, three times.
RegEx pattern normally match only an exactly defined string.
You could match several different inputs (one OR two OR three, as like (one|two|three) )
but whatever is matched is only replaced with one and the same replacement.

So you can match
"CONFIDENTIAL"
OR
"HIGHLY CONFIDENTIAL ATTORNEYS EYES ONLY"
and do an replacement, but this replacement is always the same by design.

All other possibilities would be scripting which is BRU not providing.
Use VBScript or JavaScript for that where you can match all three
possibilities and act based on the matched string and give
back an according replacement string. Or use den4b ReNamer for that matter.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to BRU Support