How to replace leading zeros in track numbers with 2 blank characters?

I have this setup for my "copy as text"

♫ $validate($num(%track%,1), ) :black_small_square: %artist% :black_small_square: %title% :black_small_square: $regexp(%_length%,^0(\d:),$1)

How do I get it to add 2 "blank characters" before single digit numbers. I tried using Alt+0160 twice for 2 blank characters but it doesn't seem to add them when actually pasting the tags to the place I

"Where do you want these? In the tracknumber?
$num(%track%,3)

AFAIK filenames with leading space characters are invalid. That is why they get cut away with $validate(). But as leading 0 are valid characters anyway, I wonder what $validate() should do in this case.

I hadn't realized that leading blanks - rather than zeros - were actually intended to be inserted; hence my previous response.

To prevent standard spaces (0x20) from appearing at the beginning or end of a filename in the first place, there is no need for $validate(), as the operating system itself prevents this.

This Microsoft article also points to other whitespace characters that might potentially be used to achieve the goal; however, I would strongly advise against pursuing such unconventional approaches.

I accidently hit enter or something while typing my original post and I had no way of editing it because it went straight to pending approval sorry!

This is being used for the copy tags to text feature so that I can copy and paste an albums information to another forum. I am trying to add 2 leading spaces (using blank characters from the character map) before single digit numbers because that is what is needed to make the information align how I want when posting to the forum. I was also trying to use the Alt+ whatever for the blank character instead of just using spaces as when I manually type the information into the other forum it deletes the leading spaces but using the "blank character" the forum doesn't delete those when posting. I am not at home now to show you how it looks, but I am not using any of this to change tags or file names its just for posting the tag information. It may not be possible but hopefully you understand what I am trying to do now.

In that case do not use $validate() as that removes the leading spaces even if they were there.
If you have special characters to add then you could use $char() or even $repeat($char(),x) to insert them as leading characters.

See more scripting functions in the documentation:

When I get home hopefully I can figure out the exact string to remove the 0 from single digit numbers and replace with a character but would char string then be $repeat($char(0160),2) because Alt+0160 is what I remember it saying on the Windows character map.

$num(%track%,1,$repeat($char(0160),2) is it something like this?

If the spaces should be in front, it should be:
$repeat($char(0160),2)$num(%track%,1)
($char() expects a decimal number - 352?)

Yes the spaces should be in front of the single digit numbers.

Google tells me the decimal code for "No-Break Space" is 160 which is just the blank char I was using 2 of to get it to align how I wanted, does this sound right?

0160 looked hexadecimal to me - I just wanted to make sure that you use the right codeformat.
For everything else, I would say: try it.

It's adding the spaces in front of the double digit numbers like 10, 11, 12 also. Not a big deal as I don't think the forum for some reason is accepting the chars as anything other than spaces, even though if I manually put the chars in it uses them. Any

Edit: actually it would work if I could get it to not put the spaces in front of 2 digit numbers! Any ideas?

Try:
`$repeat($char(160),$sub(4,$len($num(%track%,1)))´

The 4 has to be adapted to define how long the string should be of "number plus space"

No matter what I change the number 4 to it does not show the track number at all using this string haha.

I can add %track% after the string to show the track numbers but they still all have the same amount of break spaces.

♫ $repeat($char(160),$sub(4,$len($num(%track%),1)))$num(%track%,1) - %artist% - %title%
works here.

That is why screenshots or real code examples would help much more than just claims that something does not work.

Using this code: ♫ $repeat($char(160),$sub(4,$len($num(%track%),1)))$num(%track%,1) :black_small_square: %artist% :black_small_square: %title% :black_small_square: $regexp(%_length%,^0(\d:),$1)

Makes the top version of this screenshot.

Manually deleting (2 back spaces) the 2 break spaces from Tracks 10-14 produces the bottom version of the screenshot, which is what I am trying to achieve.

should be
$num(%track%,1))

Like this: ♫ $repeat($char(160),$sub(4,$len($num(%track%,1)))$num(%track%,1)) :black_small_square: %artist% :black_small_square: %title% :black_small_square: $regexp(%_length%,^0(\d:),$1)

That just puts a giant space with no track numbers.

With
♫ $repeat(#,$sub(4,$len($num(%track%,1))))$num(%track%,1) * %artist% * %title% * $regexp(%_length%,^0(\d:),$1)
I get

♫ ###6 * Aural Float * Pick up The Virus MacNeal (wThe Hugo Winterhalter) * 11:18
♫ ##96 * Taklamakan * Taklamakan [Pt.1] * 14:52
♫ ##97 * 4jäx 1/1/00 * Story of 6 - 6, Life * 15:46
♫ ##98 * Bix * Piano for the Moment * 12:07
♫ ##99 * Fortunato & Montresor * Imagine [Imagination 1] * 6:41
♫ #100 * Cold * Strobe Light Network [Flow machine remix] * 8:52

I used the # to illustrate the number of repeats

that appears to be working for me also with the # symbol showing, now how can I make it use my special breakspace instead haha.

Edit:

♫ $repeat($char(160),$sub(4,$len($num(%track%,1))))$num(%track%,1) :black_small_square: %artist% :black_small_square: %title% :black_small_square: $regexp(%_length%,^0(\d:),$1)

may work.

Edit 2: Maybe not :frowning: