# Remove last 17 characters of a filename?

**URL:** <https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986>\
**Category:** Support\
**Created:** [August 23, 2013, 7:54am UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986 "2013-08-23T07:54:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan\_sh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@alan\_sh](https://community.mp3tag.de/u/alan_sh)\
**Post date:** [August 23, 2013, 7:54am UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/1 "2013-08-23T07:54:10Z")

</div>

I have a set of files and the last 17 characters are always rubbish. Is there a way to remove them, no matter what it says?

I have looked in the "Actions" but it's not immediately obvious what I can do.

thanks for any advice

Alan

---

<div class="post-metadata">

**Author:** ![alan\_sh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@alan\_sh](https://community.mp3tag.de/u/alan_sh)\
**Post date:** [August 23, 2013, 12:09pm UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/2 "2013-08-23T12:09:59Z")

</div>

I think I need a regular expression. The bit I want to remove always starts with "b0" and always ends with "default".

Can anyone help provide me with this?

[edit]

so far I have " b0\*" replace with "mp3" as the expression wipes out the extension.  
Can it be better?

Alan

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 24, 2013, 11:36am UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/3 "2013-08-24T11:36:31Z")

</div>

> [@Alan Sharkey](#):
>
> I think I need a regular expression. The bit I want to remove always starts with "b0" and always ends with "default".
> 
> Can anyone help provide me with this?
> 
> [edit]
> 
> so far I have " b0\*" replace with "mp3" as the expression wipes out the extension.  
> Can it be better?
> 
> Alan

Help says:  
$cutRight(x,n) removes the last n characters of string x and returns the result.

So for you: $cutRight(%\_FILENAME%,17)

---

<div class="post-metadata">

**Author:** ![alan\_sh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@alan\_sh](https://community.mp3tag.de/u/alan_sh)\
**Post date:** [August 30, 2013, 2:00pm UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/4 "2013-08-30T14:00:27Z")

</div>

> [@stevehero](#):
>
> Help says:  
> $cutRight(x,n) removes the last n characters of string x and returns the result.
> 
> So for you: $cutRight(%\_FILENAME%,17)

That doesn't seem to be doing anything. In the Field box, I have "\_Filename" as the entry  
In the Regular Expression box, I have $cutRight(%\_FILENAME%,17)  
In the replace with, I have ".mp4a" (or something else).

It does nothing at all.

Alan

---

<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:** [August 30, 2013, 2:06pm UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/5 "2013-08-30T14:06:37Z")

</div>

> [@Alan Sharkey](#):
>
> That doesn't seem to be doing anything. In the Field box, I have "\_Filename" as the entry  
> In the Regular Expression box, I have $cutRight(%\_FILENAME%,17)  
> In the replace with, I have ".mp4a" (or something else).
> 
> It does nothing at all.
> 
> Alan

You have to use an action of the type "Format value" for \_FILENAME.

Alternatively, you can use Convert\>Tag-Filename with the mask  
$cutright(%\_filename%,17)  
This has even a preview.

---

<div class="post-metadata">

**Author:** ![alan\_sh](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@alan\_sh](https://community.mp3tag.de/u/alan_sh)\
**Post date:** [September 1, 2013, 2:57pm UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/6 "2013-09-01T14:57:57Z")

</div>

> [@ohrenkino](#):
>
> You have to use an action of the type "Format value" for \_FILENAME.
> 
> Alternatively, you can use Convert\>Tag-Filename with the mask  
> $cutright(%\_filename%,17)  
> This has even a preview.

Convert worked perfectly. Many thanks.

Alan

---

<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:24pm UTC](https://community.mp3tag.de/t/remove-last-17-characters-of-a-filename/14986/7 "2026-02-09T12:24:38Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


