Spaces before - and after

Hi how can I remove spaces before - and after

As MP3tag is a tagging program: my advice is fill the tags with Convert>Filename-Tag, then rename the files with Convert>Tag-Filename in a way you like, with or without spaces and hyphens.

Then there is an action of the type "Replace" with which you can replace one text constant (blank hyphen blank) with another (just hyphen).

I understand but there s no code to remove that spaces in filename I have 1000 tracks to rename

What about the attempts to import the data from the filenames into the tags first?
In Convert>Filename-Tag something like
%artist% - %title%
should lead to a lot of imported data.

You could try Convert>Filename-Filename with
Source mask: %1 - %2
Target mask: %1-%2

I want to rename like this
Florin Salam & Mr. Juve - De - ar avea inima glas
to Florin Salam & Mr. Juve - De-ar avea inima glas

Then you need a different pattern:
Source: %1 - %2 - %3
New: %1 - %2-%3

Looks good but If somebody have a code there will be perfect... Thanks

What do you mean by

?

for example Regular Expression :smiley: of Format Value ....

If you dealt with structured information in tag fields instead of the amorphous string of a filename, everything would have been easier. You chose to reject this kind of procedure.
And then - as I wrote earlier - if you replace one string constant with another you don't need a regular expression, it is just a simple "replace".
Then I wonder how often a file needs to be renamed - do you really need an action? Or isn't a one-off with a preview much more suitable?
I have the impression that an expression with %1, %2 looks a lot like code.

I apologize .... I work more with regular expressions. I hope you do not mind :innocent: :innocent:

If you look closely then you will recognize that the %1 etc... variables resemble a lot the $1... of regular expressions. I bet that you will be able to map the filename-filename patterns to a regular expression.

How can I create a action for Filename Filename ?

Not at all.
You would need an equivalent in the shape of an action of the type "Replace with regular expression" or "Format value" with a scripting function or an action of the type "Replace", all for the pseudo-field _FILENAME.
The disadvantage is that you don't get a preview.
As you can see, there is more than one way that leads to Rome.

For example I try to make a action for this how can I?

I still don't understand why you refuse to import data into the tag fields.
Handling data in tag fields is easier as you do not have to separate the individual parts but can manipulate them directly.

I tried to replace % with $ but doesnt work

Of course it does not work.
I am getting bored with this to and fro where I see not progress in respect to tagging. We are still in the state of fumbling the filename. For this purpose, I bet, there are numerous tools around to rename files.
So perhaps someone else in the forum helps you.
Or come back once you start tagging and not rename files.