Deleting or Removing Characters at the End of a String

Hello everyone,

I read through the FAQ and ran several searches in the forum (4 hours of my failure to locate an answer) in an attempt to delete some characters from the end of my title field. As I understand it, the process should work on any field. Anywhoooo

I found in the FAQ deleting leading characters where ^.{4} deleted the first 4 letters from the left. That was great and simple. My next question would be how to include deleting numbers and characters from the left. Since that was so easy, I figured the same issue for trailing characters would be easy to tackle.

So, I tried to understand some principles and arrived at the expression [4\w]$ which only removes one letter or number at a time at the end of my title and does not remove a "."

My problem is that I have a title with ".mp3" included as part of the title. No, it is not the file extension. The entire title therefore looks like this: song of the south.MP3.mp3

I want to remove the last 4 characters in the song title. In this case, the 4 characters happen to be ".mp3". I figured that I could then use the same expression and just change the number if I run into any other weirdness.

If you know where the existing post is that answers this question, please indicate.
If you can solve this problem, that would be great.
If you think there is a better way to solve this particular issue, please school me.

Thank you very much for your consideration.

Why don't you simply search and replace the incriminating string with an action.

Actually, I would always apply a filter first which meets the search criteria to macke sure that the handled files are realy the ones I want to hit. Any kind of global search and replace in databases leads to funny effects. Like the Beatles "White Album" becomes the "White A".
If you write the action, you can easily edit it to meet other string requirements, even in the middle of a title.

Last 4 characters is .{4}$
. includes numbers

1 Like

Various posts mentioned filtering and the search and replace action, but I could not figure out how to get it to work. If you know of the particular post that describes the process, I will gladly check it out.
Thank you for your suggestion.


Fantastic! Thank you very much.

I had lost the page that defined the various wild cards. I thought the secret missing ingredient was in the \w, s, d, t or something like that.

I know it's not needed now, but here's my 2 cents, which is about 10p in British money... :frowning:

Carry out a Replace action: Find .mp3.mp3 replace with .mp3

That way you guarantee that the effect will be limited to just the incorrectly named files...

i also cant understan this. anybody plz explain how to filter with a search?

Hi,

I'll try to exlain it to you.

  1. go to the menulist and select "víew -> filter"
  2. type in ".MP3.mp3"
  3. Only the files with ".MP3.mp3" in a tag field are displayed.
  4. click on a file then press "ctrl + A" to select all files
  5. go to the menulist and select "convert -> actions"
  6. click on :mt_new:, type in a name for th new action
  7. click on :mt_new:, select "replace"
  8. A new window appears, write "TITLE" in the first field
  9. type ".MP3.mp3" in the second field
  10. click on "OK" the window closes
  11. click on "OK" the seccond window closes
  12. uncheck all unanted actions and select "your action"
  13. click "OK" and wait till mp3tag has done his work
  14. now the titles of the files should be ok

I hope that this little tutourial is deatailed enough. :wink:

Greetings

1 Like

Thank you very much. I will give your filter tutorial a try.

dano, if I want to create the file name from the title tag but ignoring the last 5 characters of the title of the tag, how could I do it? which is the code to write? in my case, this involves 5 characters generic, not ".mp3".

thank you!

You can use $left(%artist%,$sub($len(%artist%),5))

1 Like

thank you dano!

One more question pliz! If I want import cover files (jpg) ignoring the last 5 characters of the name of the jpg file, how could I do it? which is the code to write? is it possible?

thank u!!!

That depends. Is the image name or part of it in the file name or in the tags?

yes, the name of image is:

name1[XXXX].jpg

the name of the video is:

name1.mp4

the name of the tags of the videos is ever diferent of the name of image file.

now I have to rename the video files to an external program and I would like to do it all with mp3tag if it possible! Only about making mp3Tag ignore the last characters in the video insertion. the photos are screenshots of the videos and the program for capture takes the name of the video and adds day, hour etc.. but the name of the jpg file always has the same length counting from the back of the file name.
thank u!

I think it is not possible.

ok, sorrow... :cry:

thank u dano

Hi!
How are you today?
Please can you help me?

I Saw Her Standing There - Live At Citi Field, NYC, 2009

I need to remove: " - Live At Citi Field, NYC, 2009"

Many thanks!
Truly yours!

Lucas

You could try "Guess value"
Source: %sourcefield%
Target: %sourcefield% - %dummy%
I cannot give you a more detailed description as you do not say in which field you want to delete the string.

Ups! I'm sorry!
Is in the Filename or the Title, I think is the same, I can modify them after...
THANKS for your prompt answer!

Lucas

No, these are totally different things.