Help - Search - Members - Calendar
Full Version: Replace some chars to " - "
Mp3tag Forums > Mp3tag - International > Support
lingburg
Hi
Im looking for some help, I want to change any of illegal filename chars (like ":", "*", "\", "/", etc) for a " - ".
Some tags have this chars, and then when I convert Tag to Filename, they are replaced with "". But then I want to replace with " - ".

How can I do that?
LyricsLover
Please have a look in the help-file "main_scripting.html":

$validate(filename, to)

Example: $validate(%artist% - %album% - %track% - %title%,-)

Thats the "magic" command. wink.gif
lingburg
thanks for the answer

but there is a way to replace only ":" and "/" for " - " ?

because tags with "?", for example, I want to leave as "" (blank) in filename.
LyricsLover
Your initial question was about valid filenames. huh.gif

You have to change this characters /?*"<>|: to something else. Otherwise, you can't save it to the filename.

What you can do, to replace single chars in all tagfields, is executing an action like this:

Aktionstyp: Ersetzen
Feld: _ALL
Original: ?
Ersetzen durch: <-- Enter a <space>!

This will replace the character ? in ALL tagfields with a <space>
(If you wanna rename the ? only in TITLE, replace _ALL with TITLE.
If you wanna rename the : with a - just replace the ? and <space> in the fields above)

Then you can rename your mp3 according to the changed tagfields like this:

Aktionstyp: Tag-Felder formatieren
Feld: _FILENAME
Formatstring: %album% - %artist% - %title%
(or whatever fields you like to use...)
lingburg
I've found a way to do what I want:
I created a new action group, called tag-filename
then I add the following:

Format value
Field: _FILENAME
Format String: %TRACK% - $caps2(%TITLE%)

then, in the same action group:

Replace with regular expression
Field: _FILENAME
Regular Expresion: "/" (without quotes)
Replace matches with: " - " (without quotes)

then add a new Replace with regular expression, modifying the "/" with ":" and the " - " with " -"

this will replace all filenames with format like this "02 - Song Title"

I don't know if there is a simple way to do this, but for now, it fits my needs smile.gif

____________________________________________________________________

So there is another question
I found that $caps2 its the best case conversion method, cause it leaves some upper case senteces like they should be, not capitalizing only the first letter like the "case conversion - mixed case" action does

So then I want some kind of case conversion that is like the $caps2, but I need that the first letters after " (_-/ " capitalize too, a feature that the case conversion action has, but $caps2 does not.

For example, a title like "Rock in the USA (yeah!)":

with $caps2, it becomes "Rock In The USA (yeah!)"
and with cave conversion action, "Rock In The Usa (Yeah!)"

When it should be like "Rock In The USA (Yeah!)"

WHAT SHOULD I DO TO SOLVE THIS?
I have trouble to to the coding =|

help me please!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.