How can I remove only the leading zero from filename and only if number has three digits?

Hello community!!! :slight_smile:

I have a bunch of tracks and their file names contain three digits at start. Something like this:
001 - Filename.mp3
060 - Filename.mp3
086 - Filename.mp3
...

As the title "says"... Is there any way to remove only the leading zero from filename and only if number has three digits?

Thank you for your time!!! :slight_smile:

You could try it with this regular expression:
$regexp(%_FILENAME%,'^0+?(\d{2})',$1)

using Convert Tag -> Tag (or an Action):
image

Short explanation:
Search for a zero at the start of the filename. it must be followed by 2 more numbers.
If found, keep only the two numbers (= remove the first zero).

Test and examples: regex101: build, test, and debug regex

1 Like

Thank you so much!!! It's done!!! :grinning:
I think I should find some time to study regexp syntax... It's making miracles!!! :laughing:

One more question please. If I would like to do this with an action?

What have you already tried?

Create a new action, select action type "Replace with regular expression".
Fill the dialog box like this:
image

1 Like

Worked too!!! :slight_smile:
And I also get an idea of the part of regexp!!! What is what...

Thank you very much for your precious time LyricsLover!!!
You really helped me here!!! :slight_smile:

1 Like

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