adding brackets to last word in filename

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

adding brackets to last word in filename

Postby Brandon » Tue Apr 29, 2014 11:58 pm

Hello,

Apologies if something similar is posted; my amateurish search didn't turn up exactly what i'm looking for.

I have a swath of file names where i want to add brackets to the last word in the name (in case you're mildly interested, I'm doing this to increase searchability after being uploaded into SharePoint).

Here's a before and after example (hoping someone can easily help me get to the "after"):

Before
14Q1 NAD highlights AABB
14Q1 NAD highlights CCD
14Q1 NAD highlights EF

After
14Q1 NAD highlights [AABB]
14Q1 NAD highlights [CCD]
14Q1 NAD highlights [EF]

As you can see, the last word in the name can be of varied length.

Thanks in advance for any help!

-Brandon
Brandon
 
Posts: 2
Joined: Tue Apr 29, 2014 11:49 pm

Re: adding brackets to last word in filename

Postby Mamagregory » Wed Apr 30, 2014 7:57 pm

Hmmm...not sure you can do that with this but I am no expert. Not that familiar with sharepoint either but wouldn't they still be searchable without the brackets? What are the brackets needed for?
Mamagregory
 
Posts: 3
Joined: Tue Apr 29, 2014 7:56 pm

Place LastWord within brackets

Postby truth » Thu May 01, 2014 2:28 pm

1Regex match/replace:
(.+) (.+)
\1 [\2]
AllText after a final-space is placed within [___]
Note this can match ANY filename with a space!

(.+) ([A-Z]+)$
\1 [\2]
Only matches filenames with All UppercaseChars after a final-space

To prevent touching previously renamed-files with [ in them, you could use:
12Filter=* !*[*
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: adding brackets to last word in filename

Postby Brandon » Thu May 01, 2014 5:38 pm

This worked great, many thanks, truth!

@Mamagregory, the brackets are to avoid getting noise in the form of those last words showing up in other, unrelated file names.
e.g., if i just had the SharePoint view look for "FI", it would return files with names like "fidelity", "final", etc. If I specify to return "[FI]", i avoid such a problem.
Brandon
 
Posts: 2
Joined: Tue Apr 29, 2014 11:49 pm


Return to BRU Support