# Removing "\_" from my filename

**URL:** <https://community.mp3tag.de/t/removing-from-my-filename/15000>\
**Category:** Support\
**Created:** [August 30, 2013, 9:59pm UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000 "2013-08-30T21:59:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![calushonator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@calushonator](https://community.mp3tag.de/u/calushonator)\
**Post date:** [August 30, 2013, 9:59pm UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000/1 "2013-08-30T21:59:15Z")

</div>

I searched for an answer through the forums, but didnt seem to find one.

Anyway, Ill give an example to show what I mean:

My filename is: `The_National_-_Rains_of_Castamere_-_from_YouTube_by_Offliberty`

So I want to remove the "\_" and replace them with spaces so that I can then easily do the Filename \> Tag `%artist% - %title%`

Or perhaps there is a direct way to do it? Its kinda hard t understand the program and its functions since im new, I only wanted to organize a few dozens of songs, so I hadn't planned to learn to use a program.  
TL:DR Could you make it easy for me to understand? 🙂

Thanks in advance.

---

<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 31, 2013, 1:09am UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000/2 "2013-08-31T01:09:39Z")

</div>

You need to remove the \_-\_from\_YouTube\_by\_Offliberty too.

Try this.

Action type: Format value  
Field: `_FILENAME`  
Formatstring: `$replace($regexp(%_filename%,_-_from_YouTube.*,),_, )`

You can then use Filename \> Tag like you said.

The above is just an action. Add one by:

1. Click ![:mt_act:](https://community.mp3tag.de/uploads/default/original/1X/318aa654f7a0c7c178d869991f6e8680b214cfc0.png ":mt\_act:")
2. Click ![:mt_new:](https://community.mp3tag.de/uploads/default/original/1X/ec5caa1b5d6c43fd0fe30efd3515a713a18c5105.png ":mt\_new:")
3. Name the action
4. Click ![](http://forums.mp3tag.de/style_emoticons/default/mt_new.png)
5. Select Format value.

---

<div class="post-metadata">

**Author:** ![calushonator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ea5d25/32.png) [@calushonator](https://community.mp3tag.de/u/calushonator)\
**Post date:** [August 31, 2013, 2:04am UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000/3 "2013-08-31T02:04:27Z")

</div>

Ughh, youre amazing! thanks so much for the help, it worked just as i wanted.

---

<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, 3:03pm UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000/4 "2013-09-01T15:03:13Z")

</div>

> [@Cal](#):
>
> Ughh, youre amazing! thanks so much for the help, it worked just as i wanted.

I did it slightly differently. I did use an Action. But when I went into the "create new action" and named it, I used the action type of "Replace" and then just put \_Filename as the first of the three parameters, an underscore as the second and a space as the third. Save that.

I could then select all the files with an underscore in the name and apply that action. No need for regular expressions.

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:** [September 1, 2013, 8:41pm UTC](https://community.mp3tag.de/t/removing-from-my-filename/15000/5 "2013-09-01T20:41:17Z")

</div>

> [@Alan Sharkey](#):
>
> No need for regular expressions...

And how would the OP get rid of \_-\_from\_YouTube\_by\_Offliberty where I presume Offliberty changes depending on the YouTube uploader.

`$replace(string,from,to)`  
`$replace(%_filename%,_, )` Is not a regular expression and very simple to understand if you read the help docs.

`$regexp(x,expr,repl)` replaces the pattern specified by the regular expression `expr` in the string `x` by `repl`.  
`$regexp(%_filename%,_-_from_YouTube.*,)` This has a very simple regexp, to delete the junk at the end.

Combine the two together where $regexp happens 1st and then the $replace 2nd.  
`$replace($regexp(%_filename%,_-_from_YouTube.*,),_, )`

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<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/removing-from-my-filename/15000/7 "2026-02-09T12:24:38Z")

</div>


