Replace characters with wildcard

Bulk Rename Utility How-To's

Replace characters with wildcard

Postby william » Wed Jun 11, 2025 5:07 pm

Good afternoon!

I have a large list of files that are exhibit for legal document. Their format is generally:

Exhibit 27 - Voucher ...
Exhibit 43a - Voucher ...

I am trying to figure out how to rename the entire list removing only the numbers 1-27, for example, and replacing the numbers wit "No"

In the case of filenames using both a number and a letter such as, 47a, I'd like to replace all numbers and the letter with "No.".

Any ideas how I can do this in the "Replace" fields of the utility?

Thanks very much,
Williamhvadney@gmail.com
william
 
Posts: 1
Joined: Wed Jun 11, 2025 4:59 pm

Re: Replace characters with wildcard

Postby Admin » Thu Jun 12, 2025 12:02 am

Hi,
Exhibit 27 - Voucher ... becomes Exhibit No - Voucher ... (only if number 1-27)
and
Exhibit 43a - Voucher ... becomes Exhibit No. - Voucher ... (for all numbers followed by a letter)
?
Admin
Site Admin
 
Posts: 2929
Joined: Tue Mar 08, 2005 8:39 pm

Replace numbers from 1-27 with "No."

Postby Luuk » Thu Jun 12, 2025 12:54 am

With Replace(3), the "Replace" and "With" could be something like...
\regex\^(Exhibit )(0*[1-9]|1\d|2[0-7])[a-z]?(?= - )
$1No.
Exhibit 1 - Text ------> Exhibit No. - Text
Exhibit 009 - Text ---> Exhibit No. - Text
Exhibit 27a - Text ---> Exhibit No. - Text
Exhibit 28 - Text ----> (not renamed)


To preserve the numbering, could instead try something like...
\regex\^(Exhibit )(0*[1-9]|1\d|2[0-7])(?=[a-z]? - )
$1No.$2
Exhibit 1 - Text ------> Exhibit No.1 - Text
Exhibit 009 - Text ---> Exhibit No.009 - Text
Exhibit 27a - Text ---> Exhibit No.27a - Text
Exhibit 28 - Text ----> (not renamed)
Luuk
 
Posts: 813
Joined: Fri Feb 21, 2020 10:58 pm

Re: Replace characters with wildcard

Postby Admin » Thu Jun 12, 2025 5:16 am

Javascript solution as an alternative:

https://www.bulkrenameutility.co.uk/js/ ... e%3B%0A%7D
Admin
Site Admin
 
Posts: 2929
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To