Page 1 of 1

Replace characters with wildcard

PostPosted: Wed Jun 11, 2025 5:07 pm
by william
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

Re: Replace characters with wildcard

PostPosted: Thu Jun 12, 2025 12:02 am
by Admin
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)
?

Replace numbers from 1-27 with "No."

PostPosted: Thu Jun 12, 2025 12:54 am
by Luuk
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)

Re: Replace characters with wildcard

PostPosted: Thu Jun 12, 2025 5:16 am
by Admin
Javascript solution as an alternative:

https://www.bulkrenameutility.co.uk/js/ ... e%3B%0A%7D