Removing "_" from my filename


#1

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? :slight_smile:

Thanks in advance.


#2

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:
  2. Click :mt_new:
  3. Name the action
  4. Click
  5. Select Format value.

#3

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


#4

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


#5

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.*,),, )

http://help.mp3tag.de/main_scripting.html