Remove numbers before filename or artist?

Hi,

I'm look for a way to remove the number(s) from the following string. Either in the filename or Artist.

Filename Structure: 16.David Guetta Feat. Emeli Sande - What I Did For Love.mp3

Artist Name Structure: 16.David Guetta Feat. Emeli Sande

What I would like to get rid of is the 16.

I have some files that also would be just 16 with no .

Can some please explain how to do this?

Much appreciated :slight_smile: :huh: :huh:

I would change the artist-name first and after changing rebuild the filename from the tags.

You could define actions group or - especially for newbies - it is easier to take the converter. The converter has a preview and it shows the result of your format-string-definitions.

  1. Convert
    Tag - Tag
    Field: TITLE
    Formatstring: $cutleft(%artist%,3)

This only works if there always 3 characters at the start.

  1. Rebuilding the filename:
    Tag - Filename
    Formatstring: %artist% - %title%

This is best done with the regular expression built in action which will take care of both scenarios.

Use for replace in two actions in one group for filename and artist:

^\d+\.*

Replace with:
Leave this field blank

That's helpful. Thanks. I never did get up to speed with regular expressions.

I use the cutLeft and mid/substr (whatever) functions to sort out Titles that have been copied from the filename - where the filename includes track number and album ...I have to modify the action each time, and count the characters.

To strip the track numbers, or replace the full stops/periods with hyphens (like replace "12." or "12. " with "12 - The Track Title"), I use RenamerNG (free program). Much easier (perhaps even if you're familiar with the mp3tag scripts/coding, because you can perform the actions on selected files, the Trim and Replace and Insert dialogs show you what the result will be, and you can Undo if it's messed-up.)

So I am a newbie to this site and stuff...

Thanks for all your great tips and suggestions! :slight_smile:

on this one from stevehero.

Not sure what to do with that script/command?

Can you walk me through what to select, and/or to do?

^\d+.*

so do I start with tag to tag choose artist then type this script and that should take care of it? Or is there there more to it?

So I am a newbie to this site and stuff...

Thanks for all your great tips and suggestions!

on this one from stevehero.

Not sure what to do with that script/command?

Can you walk me through what to select, and/or to do?

^\d+.*

so do I start with tag to tag choose artist then type this script and that should take care of it? Or is there there more to it?

The new regular expression should be for the OP

^\d+\s*[\.|-]\s*

That should cover all your bases.

For the person asking how to use it. Use an action. See FAQ section on that and use the Replace with regular expression one.

From here choose the tag you want to affect, enter in that regular expression I posted and leave the replace with field blank if you ONLY want to do the same as the OP.

1 Like

I doubt that anything could be easier and just as powerful as the functions in MP3tag.
You can do just the same things and many more with MP3tag, with the advantage that you do not have to leave MP3tag to start an external program which probably has no options to recycle any tag data.
I would think that it would be much better to get acquainted with the powers of MP3tag and leave that promoted program of yours where it is.

So i was facing a problem, the usual action suggested mostly wasn't behaving correctly because it was also removing the digits from some artists (ex.2 chainz, 20 fingers, 5 seconds of mars etc).

But the one suggested by @stevehero ^\d+\s*[\.|-]\s* is removing only the tracknumbers.

Different strokes for different folks.

^\d+\s*\.\s* Will work for 16.David Guetta Feat. Emeli Sande but not 2 chainz, 20 fingers, 5 seconds of mars

Mostly correct, but don't forget artists with names like:
1.Kla$
2. Maanantaii

There are always exceptions :wink:

Absolutely, which is why I NEVER EVER EVER run actions on the filename. Always tag then use that info to format the FN.

:slight_smile:

1 Like