# Catch the last word character and replace it

**URL:** https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239
**Category:** General Discussion
**Created:** [April 24, 2006, 2:07am UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239 "2006-04-24T02:07:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![panos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@panos](https://community.mp3tag.de/u/panos)
#### Post date: [April 24, 2006, 2:07am UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/1 "2006-04-24T02:07:11Z")

</div>

Hello to every one

Now I think this is difficult question I try to find out but no luck

i would like if the last word character is “s ” (s with space) to replace it with another character

i am going to replace it with a Greek letter “ς”  
I think is every think possible with this program

Thanks Panos

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [April 24, 2006, 5:12am UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/2 "2006-04-24T05:12:48Z")

</div>

This might help:

Action #1:  
_Action type:_ **Replace**  
_Field:_ **\_ALL**  
_Original:_ **s**  
_Replace with:_ **ς**

[] only as whole word

[x] case-sensitive comparison

Edit: Make sure you enter "s " in "Original" - the forum didn't include the trailing blank I entered.

---

<div class="post-metadata">

### Author: ![SquallLeonhart38](https://community.mp3tag.de/user_avatar/community.mp3tag.de/squallleonhart38/32/116_2.png) [@SquallLeonhart38](https://community.mp3tag.de/u/SquallLeonhart38)
#### Post date: [April 24, 2006, 6:02am UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/3 "2006-04-24T06:02:26Z")

</div>

> [@](#):
>
> Hello to every one
> 
> Now I think this is difficult question I try to find out but no luck
> 
> i would like if the last word character is “s ” (s with space) to replace it with another character  
> i am going to replace it with a Greek letter “ς”  
> I think is every think possible with this program
> 
> Thanks Panos
> 
> \<{POST\_SNAPBACK}\>

Make a new action via Option/Actions:  
Select action type: Format value

In Field-Type: TITLE  
Format string: $if($eql($right(%title%,2),s ),$left(%title%,$sub($len(%title%),2))\ς,%title%)

Now it should replace it the 's ' with 'ς' and your songs should be fine. But be aware that when you run the script on all your mp3s/wmas other whatever all the last 's ' will be removed by the sigmaf (that's the name of the letter, or???). So better run it only on the songs you want to.

When it is something other than the title, then simply replace title in every case by the field you wanted to edit.

I also added the action so you can simply download it and place it in the Applications Data folder of Mp3tag.  
To get there: Look in the options unter export and copy the folderpath you can see there. Then open the explorer and type in the adress list. Then remove \export by \data\actions and there you simply put the action in.

[Rename.zip](https://community.mp3tag.de/uploads/default/original/2X/c/cb0d8333128a4a14155c9c7bcd862b60234f7ec9.zip) (205 Bytes)

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [April 24, 2006, 7:37am UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/4 "2006-04-24T07:37:05Z")

</div>

Maybe I didn't get you right, but do you want the last "s " of the whole field to be replaced or the last "s " of each word? So, A or B:

A: "Hellos Worldus Maximus " --\> "Helloς Worlduς Maximuς"  
B: "Hellos Worldus Maximus " --\> "Hellos Worldus Maximuς"

---

<div class="post-metadata">

### Author: ![panos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@panos](https://community.mp3tag.de/u/panos)
#### Post date: [April 24, 2006, 5:04pm UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/5 "2006-04-24T17:04:37Z")

</div>

My Grand father use to say:  
Working in the night, the next day laughing

Sorry about my first letter wasn’t clear  
So this is my example and I m going to replace with “w” be easier to you.  
the LAST character ONLY if fount “s” replace with “w”

A: Someones spends lots  
B: Someonew spentw lotw

thanks again for helping me

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [April 24, 2006, 6:40pm UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/6 "2006-04-24T18:40:14Z")

</div>

OK, use my action then (and don't forget to use "s " in Original and not "s"). In order to replace the very last "s" (since it isn't followed by a space), use:

Action #1:  
_Action type:_ **Replace with regular expression**  
_Field:_ **\_ALL**  
_Regular expression:_ **s$**  
_Replace matches with:_ **ς**

[x] case-sensitive comparison

---

<div class="post-metadata">

### Author: ![panos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@panos](https://community.mp3tag.de/u/panos)
#### Post date: [April 26, 2006, 5:39pm UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/7 "2006-04-26T17:39:49Z")

</div>

SquallLeonhart38 wrote:

Now it should replace it the 's ' with 'ς' and your songs should be fine. But be aware that when you run the script on all your mp3s/wmas other whatever all the last 's ' will be removed by the sigmas (that's the name of the letter, or???). So better run it only on the songs you want to

A:  
Yes is what I want because all of the words that ending with “s” we writing with “ς” and if there is a sigma in between we writing with “σ”. Thanks again

## I have to say thanks for both of you, was nice job

Last night I was dreaming about mp3tag and….  
I going to baptize my new action “Greeklish to Greek” so now you understand this is a just converter  
(Converts from Latin characters to Greek proper character, From example “eureka” to “ευρικα”. )  
And I am writing here to this forum maybe some one that use this program is interesting to know about. When I will finish this project I will upload in this forum.  
Some Greek people they know there are some Greeklish txt converters but there are just a simple ones and I like this project to teach it some more Greek grammar so can convert to the limit. Of cause I know will be difficult because there are so many compilation in Greek grammar but I can try.

Now because in this action will be many replacement and I would like to have the shortest way so when convert an album to be quickly. I like to teach me one more thing. My example this time will be clearer than the fist time 

I would like a word that STARTS with “k” or “t” or “ch” or “m” the previous word letter to be “n” even if it does not exist in the previous word, but if “n” exist just keep it

A: The cake is sweet there are challenging  
B: The cake is sweetn there aren challenging

A: then table is missing  
B: then table isn missing

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [April 26, 2006, 6:33pm UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/8 "2006-04-26T18:33:58Z")

</div>

I am really tired and therefore cannot guarantee that this works:

Action #1:  
_Action type:_ **Replace with regular expression**  
_Field:_ **\_ALL**  
_Regular expression:_ **([^n]) (k|t|ch|m)**  
_Replace matches with:_ **$1n $2**

[x] case-sensitive comparison

---

<div class="post-metadata">

### Author: ![Stem75](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stem75/32/5007_2.png) [@Stem75](https://community.mp3tag.de/u/Stem75)
#### Post date: [July 21, 2018, 2:21pm UTC](https://community.mp3tag.de/t/catch-the-last-word-character-and-replace-it/3239/9 "2018-07-21T14:21:45Z")

</div>

OK it's been years but I understand that you (and anyone who might be interested) want to translate greeklish to greek so I suggest to translate all characters to greek as usual and then use this [Sigma Zeichen ersetzen](https://community.mp3tag.de/t/sigma-zeichen-ersetzen/12697/5?u=stem75) for the special case of the letter Σ in the end.
