#1 2008-08-06 04:37

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Removing a simbol at last position

I'd like to remove a simbol form the last position of the name, but not the last occurrence, last position

for example I have:
"ReNamer-" and I want to get "ReNamer", but if there is another file called "Re-Namer" I don't want "ReNamer"

May be this could be another suggestion, but I'm making a lot lol

Last edited by SafetyCar (2008-08-06 04:39)


If this software has helped you, consider getting your pro version. :)

Offline

#2 2008-08-06 16:12

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Removing a simbol at last position

No, it doesn't need new suggestion.
Use Regex rule.
Expression: "-$"
Replace: ""

or

Expression: "(.+)-$"
Replace: "$1"

They both do the same ;P

Just remember to have "skip extention" checked.

"$" in Regex expression stands for "last position" or maybe "end of string"...

Last edited by krtek (2008-08-06 16:12)


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#3 2008-08-06 17:11

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 329

Re: Removing a simbol at last position

Hi krtek nice to hear you again for a while wink. Where you've been? tongue

I presumed that RegEx can do the job. I looked and found this topic with similar request just it's for spaces and for beginning of filename Remove leading spaces from side of filename

Could you copy your post here (ReNamer: Examples of Regular Expressions) for future reference? Thanks wink

Anyway I have one question about this situation:

1990porsche911carrera2guardsred0001a.jpg     to be     1990 porsche 911 carrera 2 guardsred 0001 a.jpg
1990porsche911carrera2guardsred0001j.jpg      to be     1990 porsche 911 carrera 2 guardsred 0001 j.jpg

I tried this one: Expression: (\d)([a-z])
                       Replace: $1 $2           (case sensitive)

but gets this 1990 porsche911 carrera2 guardsred0001 a.jpg
                   1990 porsche911 carrera2 guardsred0001 j.jpg     sad

Can you help me roll

Edit: I'm preparing to go to village so I'll be absent for several days.

Last edited by eR@SeR (2008-08-06 17:25)


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#4 2008-08-07 22:00

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Removing a simbol at last position

Hi eR@SeR,
Im still here, almost every day wink There weren't simply anything I could help about and as the Polish poet Julian Tuwim said:
Be blessed, who having nothing to say, does not express that in a river of words.

Simplest solution for your problem is to do this in two rules...
The second one will be:

Expression: ([a-z])(\d)
Replace: "$1 $2"

Last edited by krtek (2008-08-07 22:03)


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#5 2008-08-11 17:18

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 329

Re: Removing a simbol at last position

Hi, I'm back smile

Im still here, almost every day...

It was strange how you didn't post any your opinion (here maybe ReNamer: New rule "Ignore") or suggestion, so I was worried roll

Simplest solution for your problem is to do this in two rules...
The second one will be:

Expression: ([a-z])(\d)
Replace: "$1 $2"

As you said once: Sometimes the simplest things are hardest to find... tongue

Thanks wink

Last edited by eR@SeR (2008-08-11 17:18)


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#6 2008-08-12 15:25

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Removing a simbol at last position

Thanks krtek!!! big_smile

I was thinking on inserting a special prefix, something unique like %#@$ and after that 2 rules one to remove -%#@$ and other if there isn't the symbol to %#@$
mad

I prefer your suggestion lol lol


If this software has helped you, consider getting your pro version. :)

Offline

#7 2008-08-13 16:01

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Removing a simbol at last position

Back to the start of th topic

krtek wrote:

Use Regex rule.
Expression: "-$"
Replace: ""

Is anyway to do the same withe dots??? I've tried it but it's a special character


If this software has helped you, consider getting your pro version. :)

Offline

#8 2008-08-13 16:08

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Removing a simbol at last position

Special characters in RegExes need to be escaped with backslash.
So your expression will be:
\.$


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#9 2008-08-13 16:28

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Removing a simbol at last position

Thanks for that wink

Anyway, sorry, it was clear on the User Manual

You can cause characters that normally function as metacharacters or escape sequences to be interpreted literally by "escaping" them by preceding them with a backslash "\", for instance: metacharacter "^" match beginning of string, but "\^" match character "^", "\\" match "\" and so on.


If this software has helped you, consider getting your pro version. :)

Offline

#10 2008-08-16 23:12

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 329

Re: Removing a simbol at last position

As we speak about problems in renaming using RegEx...

Problem is about renaming specific words in filename (Case changes)...


To be more precise I'll show you on example:


Eddy Wata - I Love My People.mp3 ---> Eddy WATA - I Love My People.mp3
Geo Da Silva - Feelin' So Good (Long Mix).mp3 ---> Geo Da SILVA - Feelin' So Good (Long Mix).mp3


As you can see I want to make last word (surname) in "ALL UPPER CASE" before dash. I tried everything to find any "case changing" syntax in RegExs for doing this job but I failed sad Maybe I missed something and I hope that you can help me smile


Also I would like to know solution for this example (if possible):


David Guetta Feat. Chris Willis - Love Is Gone (Original Mix).mp3 ---> David GUETTA Feat. Chris WILLIS - Love Is Gone (Original Mix).mp3


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

Board footer

Powered by FluxBB