Welcome Guest

Pages: 1
Padding various numbers to 4 digits
SnowdogPostJune 22, 2023, 14:02
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicPadding various numbers to 4 digits

I like to have the BWV numbers at the beginning of each line of the Bach sets padded to 4 digits, so that they line up neatly. The problem is that the start number varies from 1-4 digits (and obviously, the 4 digit ones don't need padding).

Is there a way to automate this?

In this case it will always be preceded by "BWV-space" so there's a handy pattern.

In a different scenario the pattern might be different so I'm wondering...

Is this something that's tucked away in Yate?

If an action is required, could a pattern be entered manually & an amount of padding be dictated so that I can use it elsewhere?

Image

2MR2PostJune 22, 2023, 14:58
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicPadding various numbers to 4 digits

Download the action at: https://2manyrobots.com/actions/Replace-Pattern-n-with-Pattern-nnnn.zip

You enter a case sensitive pattern. The 'pattern #' sequence can be anywhere in the Title field ... however only the first match is processed. As written, there must be a single space after the pattern before the #.

The action is called: Replace Pattern # with Pattern ####

It can be run stand alone, from the MFE or from the Title field's function button. It only processes the Title field.

SnowdogPostJune 22, 2023, 15:20
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicPadding various numbers to 4 digits

That's fantastic, thanks!

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.013 seconds.