Change file extension to lowercase - Regular expression

Seems like the regular expression thread is locked

Previously found some nice examples there, why was it closed?

Not an overly complex one but couldn't find it so posting here in case it's useful to someone else:

Had a number of uppercase file extensions and was looking to convert them all to lowercase; there doesn't seem to be such a thing as the '"file extension" field so here's my take on it:

Field : _FILENAME
Regular expression : \.(.*)$
Replace with : .$lower($1)

Cheers,

1 Like

There is:
%_extension%
The example that you give is not complete as it does not state which field/property you treat with the action.

The same could probably be achieved with an action of the type "Format value" for _EXTENSION and
Format string: $lower(%_extension%)
Or an action of the type "Case conversion" for the same field.
Provided, this would work at all.
I tried the action and I see no difference.

Thanks for the feedback, I have updated the field used above;

I have the latest version and my first thought was indeed to use case conversion but for some reason, I just don't see the _EXTENSION field as available. Probably missing something obvious in settings, will check again...

If the field does not appear in the list, you can type it in.

Even if the preview indicate that this SHOULD work, it doesn't change anything at the filename and/or extension:

Windows 10, NTFS, Mp3tag v3.19

Update #1:
Using _FILENAME_EXT with or without enclosing %-Characters creates a new tag with the same name. :blush:

Update #2: Convert Filename - Filename doesn't change the syntax of the extension (but works for the filename itself, without extension):
image

Ok got it. If I may: any reason why it doesn't appear in the list? thx

Perhaps because it is a property like _LENGTH or _MODE that cannot be modified?

I've tried these without success:

image

image

In case it doesn't work, I have slightly updated my original Regex, works fine.

You are right, my
Album NAMe (WITH CAPITAL AnD MixEd Letters) and UPPERCASE EXTENSION.MP3
becomes
Album NAMe (WITH CAPITAL AnD MixEd Letters) and UPPERCASE EXTENSION.mp3
using "Replace with regular expression":
image

Great, glad it works for you as well.
at least there is a working option.

@ohrenkino, let us know if the _EXTENSION field works on your end.

Thanks,

It does not.
I checked the documentation and found

  • _FILENAME denotes the file name of the file including its extension
    which apparently is the only way to treat the extension

That's strange, because in the help we can also find two placeholders,
one without and one including the extension:

And in the section above we see for technical information:

Technical information fields begin with an underscore %_ and are read-only.

The special treatment of the _FILENAME concerns only the action "Replace with regular expression".

Thanks for your prompt responses;
Guess my post/regex was useful after all :grinning:
Cheers,

Ahhh found it here:
Thanks for clarification about Replace with Regular Expression

This action file, below, will solve your problems, and if you're looking to change the file extension of a file, in a WYSWYG manner, visit this community post: FINALLY SOLVED: ACTIONS that mimics a WYSIWYG to Change File Extension or File Name and Extension (2022-2023)

There is no additional fields or placeholders required for this action. Just place it inside the actions folder, which is located here: %AppData%\Mp3tag\data\actions or C:\Users%username%\AppData\Roaming\Mp3tag\data\actions

CONVERT File Extension (%_extension%) to Lowercase by wneclass2018 (February 20th 2023).mta (759 Bytes)

Thanks for the additional option =)
would be nice to have this feature natively though.
Cheers,