# Filename \> Tag: Drop leading zero on tracknumber

**URL:** https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861
**Category:** Support
**Created:** [May 28, 2024, 6:56pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861 "2024-05-28T18:56:12Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [May 28, 2024, 6:56pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/1 "2024-05-28T18:56:12Z")

</div>

I have filenames in the format: 01 - Title - Artist - Album  
When I import the tags from the filename, is there a way to drop the leading zero?

In Tag to Tag we can use functions to do this, but in Filename to Tag functions aren't supported. And I hate having to do two actions for one thing.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 28, 2024, 7:14pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/2 "2024-05-28T19:14:04Z")

</div>

You could use an action of the type "Guess value" instead - that allows scripting functions.

> **[Guess Values – Mp3tag Documentation](https://docs.mp3tag.de/actions/guess/)**
>
> Documentation on the Guess Value action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [May 28, 2024, 7:15pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/3 "2024-05-28T19:15:01Z")

</div>

I know, but that still requires an extra step in the process

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 28, 2024, 7:16pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/4 "2024-05-28T19:16:18Z")

</div>

If you use "Guess value" instead of the Converter then it stays 1 step.

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [May 28, 2024, 7:23pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/5 "2024-05-28T19:23:32Z")

</div>

Ok, you've lost me, Convert menu is just the same options as on the toolbar.  
And in the Action list there's no Convert other than for codepage.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 28, 2024, 7:28pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/6 "2024-05-28T19:28:09Z")

</div>

Did you have a look at the linked documentation?

The action "Guess value" allows as source string a format string which means that you could structure the data from \_FILENAME in such a way that you do not get a leading zero and then assign that structured string to a pattern of fields.  
The disadvantage is that there is no preveiw but it is more flexible as it is not limited to the filename as source.

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [May 28, 2024, 7:31pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/7 "2024-05-28T19:31:21Z")

</div>

Yes I did, and I don't see any way to use Guess Values where the source of the data is the filename itself.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 28, 2024, 7:40pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/8 "2024-05-28T19:40:23Z")

</div>

> [@FaceCrap](#):
>
> 01 - Title - Artist - Album

You could try "Guess value" with  
Source: `$num(%_FILENAME%,1)==$regexp(%_FILENAME%,(\d+) - (.*),$2)`  
Target pattern: `%track%==%title% - %artist% - %album%`

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [May 28, 2024, 7:54pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/9 "2024-05-28T19:54:38Z")

</div>

Sheesh, talk about a convoluted way to get around Filename \> Tag not supporting functions...

But anyways, much obliged, would never have figured this myself...

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 28, 2024, 7:56pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/10 "2024-05-28T19:56:37Z")

</div>

> [@FaceCrap](#):
>
> talk about a convoluted way to get around

Indeed. 2 Steps would be much easier and more straightforward. But you

> [@FaceCrap](#):
>
> hate having to do two actions for one thing.

---

<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: [June 27, 2024, 7:56pm UTC](https://community.mp3tag.de/t/filename-tag-drop-leading-zero-on-tracknumber/64861/11 "2024-06-27T19:56:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
