# Add length to the filename

**URL:** <https://community.mp3tag.de/t/add-length-to-the-filename/58962>\
**Category:** Support\
**Created:** [November 4, 2022, 2:17am UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962 "2022-11-04T02:17:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjnisbett](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mjnisbett/32/12573_2.png) [@mjnisbett](https://community.mp3tag.de/u/mjnisbett)\
**Post date:** [November 4, 2022, 2:17am UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962/1 "2022-11-04T02:17:10Z")

</div>

All I want to do is add the length of the mp3 track to the filename [i.e., filename (5m 13s).mp3]. What is the easiest way to do so? I tried %\_length% and other attributes but nothing worked. Please help!

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [November 4, 2022, 3:14am UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962/2 "2022-11-04T03:14:19Z")

</div>

Use this:  
`%_filename% '('$replace(%_length%,:,m )s')'`  
as a column heading.  
Then apply the code as needed.

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 4, 2022, 7:47am UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962/3 "2022-11-04T07:47:39Z")

</div>

You can use Convert Tag -\> Filename (ALT + 1)

with this Format string:  
`%_filename% '('$replace(%_length%,_,m )s')'`

![image](https://community.mp3tag.de/uploads/default/original/2X/e/edef7de2d87cd3e9fb298bfb280d1e00e67c2888.png)

Or an action from type "Format Value" for the field `_FILENAME` with the Format string:  
`%_filename% '('$replace(%_length%,:,m )s')'`  
as @ryerman wrote.

---

<div class="post-metadata">

**Author:** ![mjnisbett](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mjnisbett/32/12573_2.png) [@mjnisbett](https://community.mp3tag.de/u/mjnisbett)\
**Post date:** [November 4, 2022, 12:34pm UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962/4 "2022-11-04T12:34:56Z")

</div>

Works perfectly! Thank you very much, LL!

---

<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:** [December 4, 2022, 12:35pm UTC](https://community.mp3tag.de/t/add-length-to-the-filename/58962/5 "2022-12-04T12:35:01Z")

</div>

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