# pad filenames with spaces

**URL:** https://community.mp3tag.de/t/pad-filenames-with-spaces/2146
**Category:** Support
**Created:** [July 28, 2005, 11:30pm UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146 "2005-07-28T23:30:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JDP](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/c6cbf5/32.png) [@JDP](https://community.mp3tag.de/u/JDP)
#### Post date: [July 28, 2005, 11:30pm UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/1 "2005-07-28T23:30:02Z")

</div>

All my files have good ID tags but they are sorted into folders for the artitst so the filenames are just the titles of the songs.

But in order to format the filenames for my car I need to pad them with spaces at the end to push out the .mp3 to exactly 24 characters so it doesn't show on the screen.

I know how to add a fixed number of spaces to the end of all the songs, but I want all the filenames the same length...24 characters and since the song titles all have different lengths that means I need to add a different number of spaces to each file to get it to 24.

So, for example I want the files to go from this:

Imagine.mp3  
Take Me To The Pilot.mp3

to This:

Imagine\_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ _.mp3  
Take Me To The Pilot_ \_ \_ \_.mp3

They don't line up because of the different spacing in this forum but they are the same number of characters. In the example, the \_ 's represent blank spaces (ignore the spaces between the lines, I needed to put them there so it wouldn't look like a single line).

What I mean is: "Imagine" is 7 characters and to make the filename 24 characters you need to add 17 spaces. "Take me to the Pilot" is 20 characters so you only need to add 4 spaces to make the filename total 24 characters.

Are there any wildcard characters that will create filenames all the same length but leave any characters in the beginning alone?

Thanks for any advice.  
JDP

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [July 29, 2005, 5:03am UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/2 "2005-07-29T05:03:34Z")

</div>

I'm afraid you can't do it at the moment since there is no function for inserting a character X number of times.  
For determining the number of spaces to add, you could use the following:

_$sub($len(%\_filename%),24)_

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [July 29, 2005, 10:21am UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/3 "2005-07-29T10:21:52Z")

</div>

You can use Filename-Filename Converter (ALT+3) with

```
Mask: %1
Formatstring: $left(%1 , 24)

```

There are 24 spaces after %1 in formatstring so it wil add them to filename and then use first 24 characters as new filename.  
You can add conditional testing if the length of filename \> 24 to leave filename unchanged for long filenames.

Regards  
nickless

---

<div class="post-metadata">

### Author: ![JDP](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/c6cbf5/32.png) [@JDP](https://community.mp3tag.de/u/JDP)
#### Post date: [July 29, 2005, 1:46pm UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/4 "2005-07-29T13:46:01Z")

</div>

QUOTE (nickless @ Jul 29 2005, 13:21)

You can use Filename-Filename Converter (ALT+3) with

```
Mask: %1
Formatstring: $left(%1 , 24)

```

There are 24 spaces after %1 in formatstring so it wil add them to filename and then use first 24 characters as new filename.  
You can add conditional testing if the length of filename \> 24 to leave filename unchanged for long filenames.

Regards  
nickless

\<{POST\_SNAPBACK}\>

Thanks for the help guys. nickless's code did the trick! Very cool. This program is unbelievable. I really appreciate the input.

Regards,  
JDP

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 30, 2005, 2:17pm UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/5 "2005-07-30T14:17:39Z")

</div>

nickless, thanks for your help!

It's a great idea 🙂

Best regards,  
~ Florian

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:19pm UTC](https://community.mp3tag.de/t/pad-filenames-with-spaces/2146/6 "2026-02-09T12:19:25Z")

</div>


