# Rename Tag-Filename Script HELP (remove space if no Series present)

**URL:** https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664
**Category:** Support
**Created:** [November 29, 2024, 2:41am UTC](https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664 "2024-11-29T02:41:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SoCalDad](https://community.mp3tag.de/user_avatar/community.mp3tag.de/socaldad/32/15526_2.png) [@SoCalDad](https://community.mp3tag.de/u/SoCalDad)
#### Post date: [November 29, 2024, 2:41am UTC](https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664/1 "2024-11-29T02:41:40Z")

</div>

Hi!  
Stuck on how to write this out to have it remove (or add) an extra space if a "Series" field is or isn't present... I've tried with removing spaces but one or the other scenario is always off if I apply the formula across all files.

Thought someone might know a clean solution....

%album% (%year%) ['['%series% %series-part%']'] - $num(%track%,2)

Ex. with Series  
The House in the Cerulean Sea (2020) [Cerulean Chronicles 1]- 12.mp3 (lose a space)  
The House in the Cerulean Sea (2020) [Cerulean Chronicles 1] - 12.mp3 (desired)

Ex. without Series  
The Bones Beneath My Skin (2023) - 01.mp3 (desired)  
The Bones Beneath My Skin (2023) - 01.mp3 (extra space)

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [November 29, 2024, 5:37am UTC](https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664/2 "2024-11-29T05:37:27Z")

</div>

You have to put a space before the last closing square bracket:  
`%album% (%year%) ['['%series% %series-part%']' ] - $num(%track%,2)`

---

<div class="post-metadata">

### Author: ![SoCalDad](https://community.mp3tag.de/user_avatar/community.mp3tag.de/socaldad/32/15526_2.png) [@SoCalDad](https://community.mp3tag.de/u/SoCalDad)
#### Post date: [November 29, 2024, 5:40am UTC](https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664/3 "2024-11-29T05:40:50Z")

</div>

Huzzah! I poked around with adding spaces but only succeeded in mis-positioning that bracket... I think I was putting it on the wrong side of the quote... Thanks!

---

<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 29, 2024, 5:41am UTC](https://community.mp3tag.de/t/rename-tag-filename-script-help-remove-space-if-no-series-present/66664/4 "2024-12-29T05:41:07Z")

</div>

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