# How to rename file with Action including %\_length%?

**URL:** https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233
**Category:** Support
**Created:** [October 12, 2024, 12:35am UTC](https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233 "2024-10-12T00:35:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Lou2k7](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8dc957/32.png) [@Lou2k7](https://community.mp3tag.de/u/Lou2k7)
#### Post date: [October 12, 2024, 12:35am UTC](https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233/1 "2024-10-12T00:35:22Z")

</div>

Hi All,

I was hoping someone could tell me what I'm doing wrong.  
I'm trying to rename a file after doing a list of actions.  
My final action is to format value,  
Fieldname: \_FILENAME Value: '%artist% ~ %album% ~ Time %\_length%'  
It does rename the file, but the reads, Artist ~ Album ~Time 165445

If I do a Convert TAG--\>FIlename Value ' %artist% ~ %album% ~ Time %\_length%'  
the output is Artist ~ Album ~Time 16\_54\_45

I can't seem to find an option to use Tag-Filename in the action options.  
I'm trying to add the underscores to the time with an action command.

I'm sure it's something simple. I couldn't find anything on this searching.  
Thank you

---

<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: [October 12, 2024, 9:02am UTC](https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233/2 "2024-10-12T09:02:31Z")

</div>

Since `:` is not a valid character for Windows filenames, you can try `%_length%` with `$validate()` and replace the `:` with an underscore:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/e/7/e77344fde541b52ffc8bb07f49c2e4f7d494d93f.png)

Field:  
`_FILENAME`  
Format string:  
`%artist% ~ %album% ~ Time $validate(%_length%,_)`  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/2/9/29517ab6c992f38ac67874f87527f39d2663a978.png)

And you are right:  
Convert Tag -\> Filename automatically applies this validation and replaces the : with and \_

**Hint:**  
Since the ARTIST and ALBUM could also contain not allowed characters in the Windows filename (like `/?*"<>|:` ) you should think about what you want do with such characters.

---

<div class="post-metadata">

### Author: ![Lou2k7](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8dc957/32.png) [@Lou2k7](https://community.mp3tag.de/u/Lou2k7)
#### Post date: [October 12, 2024, 2:21pm UTC](https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233/3 "2024-10-12T14:21:33Z")

</div>

Thank you this works great! Everyone here is awesome, always will to help out!

---

<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: [November 11, 2024, 2:21pm UTC](https://community.mp3tag.de/t/how-to-rename-file-with-action-including-length/66233/4 "2024-11-11T14:21:41Z")

</div>

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