IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

 
Reply to this topicStart new topic
> Please help with another special regular expression
globetrotters1
post Oct 13 2010, 11:12
Post #1


Member


Group: Full Members
Posts: 21
Joined: 25-December 09
Member No.: 11540
Mp3tag Version: 2.48



Well, thanks for the help with the "in" before Dur/moll, just works perfectly the way you told me...

There are two problems left, one of which I think you can solve, the other will be unsolvable.

Problem 1:

Some track names I get from Amazon or freedb have "in B" at the end of the filename, just before the file extension. I want to catch those and replace them with "in H-Dur" (if capital B of course). otherwise to "in h-moll". I could solve all cases in which this expression shows up somewhere else in the filename, just the end of line case is a problem.

I want to exclude the cases in which it already has a Dur or moll signature.

Additionally it should also replace "in B flat" to "in B-Dur" and "in fis sharp" to "in fis-moll". So also the expressions "flat/bemol" and "sharp/#/diese/dièse/diesis/sostenido" should be honored correctly. Then all common key signature languages (eng/fra/ita/esp) are included. I think the simplest way would be to first replace all these special ending values into "flat" or "sharp" and then process one expression which does the formatting of the value

Problem 2 (which I think is unsolvable):

The formatting I receive from Amazon or freedb looks like this
01 - String Quartet No 14 in d-moll, D 810 - Allegro
02 - String Quartet No 14 in d-moll, D 810 - Andante con moto
03 - String Quartet No 14 in d-moll, D 810 - Scherzo: Allegro molto
04 - String Quartet No 14 in d-moll, D 810 - Presto
and I would like to have it like this
01 - String Quartet No 14 in d-moll, D 810 - I - Allegro
02 - String Quartet No 14 in d-moll, D 810 - II - Andante con moto
03 - String Quartet No 14 in d-moll, D 810 - III - Scherzo: Allegro molto
04 - String Quartet No 14 in d-moll, D 810 - IV - Presto

That would mean that I can do a roman number sequencing action in consecutive tracks I highlight. Until now I have to do all this manually, which is very time consuming smile.gif

And to make it even more difficult, it would be very cool to be able to solve "elimination of same string elements from second occurrence on", so that it looks like this
01 - String Quartet No 14 in d-moll, D 810 - I - Allegro
02 - II - Andante con moto
03 - III - Scherzo: Allegro molto
04 - IV - Presto

Appreciate your help!
Thanks
laugh.gif

This post has been edited by globetrotters1: Oct 13 2010, 11:17
Go to the top of the page
 
+Quote Post
globetrotters1
post Oct 24 2010, 17:12
Post #2


Member


Group: Full Members
Posts: 21
Joined: 25-December 09
Member No.: 11540
Mp3tag Version: 2.48



where are the 'Regular Expression Geeks', who can help??
smile.gif
Go to the top of the page
 
+Quote Post
DetlevD
post Oct 24 2010, 18:35
Post #3


Member


Group: Full Members
Posts: 5041
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (globetrotters1 @ Oct 24 2010, 18:12) *
where are the 'Regular Expression Geeks', who can help??smile.gif

A club-mate always says, if you are looking for a helping hand, then look at the end of your arm.

Regex: Roman numerals in uppercase
http://forums.mp3tag.de/index.php?showtopi...ost&p=48483

Converting roman to arabic number and vice versa, - implemented as action groups -
http://forums.mp3tag.de/index.php?showtopi...ost&p=22169

All music related knowledge stuff is up to you.
G flat = Ges
G sharp = Gis
English B = German H
http://en.wikipedia.org/wiki/Note

"Elimination of same string elements on repeated occurrences"
This might be possible by tricky usage of Mp3tag export scripting language, but never did it before, so the current status of this wish will be "impossible" further on.

DD.20101024.1935.CEST


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
pone
post Oct 24 2010, 22:20
Post #4


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



QUOTE (globetrotters1 @ Oct 13 2010, 12:12) *
Problem 2 (which I think is unsolvable):

The formatting I receive from Amazon or freedb looks like this
01 - String Quartet No 14 in d-moll, D 810 - Allegro
02 - String Quartet No 14 in d-moll, D 810 - Andante con moto
03 - String Quartet No 14 in d-moll, D 810 - Scherzo: Allegro molto
04 - String Quartet No 14 in d-moll, D 810 - Presto
and I would like to have it like this
01 - String Quartet No 14 in d-moll, D 810 - I - Allegro
02 - String Quartet No 14 in d-moll, D 810 - II - Andante con moto
03 - String Quartet No 14 in d-moll, D 810 - III - Scherzo: Allegro molto
04 - String Quartet No 14 in d-moll, D 810 - IV - Presto

That would mean that I can do a roman number sequencing action in consecutive tracks I highlight. Until now I have to do all this manually, which is very time consuming smile.gif

And to make it even more difficult, it would be very cool to be able to solve "elimination of same string elements from second occurrence on", so that it looks like this
01 - String Quartet No 14 in d-moll, D 810 - I - Allegro
02 - II - Andante con moto
03 - III - Scherzo: Allegro molto
04 - IV - Presto

Appreciate your help!
Thanks
laugh.gif



Actiongroup:
1. Format Value:
Field:
TITLE
Format String:
$regexp(%title%,(.*?) - (.*?) - (.*),$1) - $if($eql($left(%title%,2),01),$regexp(%title%,(.*?) - (.*?) - (.*),$2 - $1),$regexp(%title%,(.*?) - (.*?) - (.*),$1)) - $regexp(%title%,(.*?) - (.*?) - (.*),$3)

2. Replace with regular expression:
Field:
TITLE
Regular Expression:
- (\d\d) -
Replace matches with:
- $replace($1,01,I,02,II,03,III,04,IV,05,V,06,VI,07,VII,08,VIII,09,IX,10,X) -


works for roman numbers I-X, but you can append as many numbers as you need in the last string.



EDIT:
Problem 1 sounds simple:
Include for every every key-signature which sould be changed something like this:

Action: Replace
Field: TITLE
Original: in B
Replace with: in H-Dur

will be a lot of work for 4 different languages and the different key signatures.

This post has been edited by pone: Oct 24 2010, 22:39
Go to the top of the page
 
+Quote Post
globetrotters1
post Oct 28 2010, 17:58
Post #5


Member


Group: Full Members
Posts: 21
Joined: 25-December 09
Member No.: 11540
Mp3tag Version: 2.48



QUOTE (pone @ Oct 24 2010, 16:20) *
...
Problem 1 sounds simple:
Include for every every key-signature which sould be changed something like this:

Action: Replace
Field: TITLE
Original: in B
Replace with: in H-Dur

will be a lot of work for 4 different languages and the different key signatures.


Thanks for your hints... but...

It's not that simple...

It's just the "end of line" situation which is tricky. Within a title value I wrote different replacement actions (for every different language and also for the short values)

The problem is that I don't want to make out of
performed in Bratislava
a
performed in H-Durratislava

Wouldn't make much sense

So for the short signatures I check "in B " (with a space) or "in B," and replace it with H-Dur

The end of line situation is the problem... (before the file extension)

I want to check if the string terminates with "in X" (X can be 1-3 characters wide) and if X begins with a capital letter then add a " major", with a lower case character a " minor"

Then I can replace with my english to german action easily
smile.gif
Go to the top of the page
 
+Quote Post
globetrotters1
post Oct 28 2010, 18:00
Post #6


Member


Group: Full Members
Posts: 21
Joined: 25-December 09
Member No.: 11540
Mp3tag Version: 2.48



And thanks for your suggestion of the numbering problem...

It doesn't work

Because it just works if the track numbers are 01 to 04... but what if the tracks of these four movements are 07 to 11?

Anyway, I thought it will be not to solve
But thanks for the nice hint smile.gif

The only way to solve this problem would be if you could refer to the previous track title and depending on the roman number you set there you would set the next roman number in the actual line value... hope that this was understandable, lol

This post has been edited by globetrotters1: Oct 28 2010, 18:08
Go to the top of the page
 
+Quote Post
DetlevD
post Oct 28 2010, 18:31
Post #7


Member


Group: Full Members
Posts: 5041
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (globetrotters1 @ Oct 28 2010, 18:58) *
... I want to check if the string terminates with "in X" (X can be 1-3 characters wide) ...

A filter string could look like this (case sensitive):
"%_FILENAME%" MATCHES "(?-i)in (Ces|Ges|Des|As|Es|B|F|C|G|D|A|E|H|Fis|Cis|as|es|b|f|c|g|d|a|e|h|fis|cis|gis|dis
|ais)$"


A filter string could look like this (case insensitive):
"%_FILENAME%" MATCHES "in (a|ais|as|b|c|ces|cis|d|des|dis|e|es|f|fis|g|ges|gis|h)$"

A filter string could look like this (case insensitive):
"%_FILENAME%" MATCHES "in (((c|d|g)((e|i)s)?)|(a(is|s)?)|(es?)|(f(is)?)|b|h)$"

Testfiles:
Attached File  20110104.Test.Tonarten.zip ( 6.84K ) Number of downloads: 61


DD.20101028.1931.CEST
Edit.DD.20110104.1552.CET

This post has been edited by DetlevD: Jan 4 2011, 15:49


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
pone
post Oct 28 2010, 20:56
Post #8


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



ZITAT(globetrotters1 @ Oct 28 2010, 19:00) *
And thanks for your suggestion of the numbering problem...

It doesn't work

Because it just works if the track numbers are 01 to 04... but what if the tracks of these four movements are 07 to 11?

Anyway, I thought it will be not to solve
But thanks for the nice hint smile.gif

The only way to solve this problem would be if you could refer to the previous track title and depending on the roman number you set there you would set the next roman number in the actual line value... hope that this was understandable, lol


Ah, ok, I thought Roman I always coresponds to Arabic 1. I'll think about it.
Go to the top of the page
 
+Quote Post
pone
post Oct 29 2010, 02:14
Post #9


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



Problem 1:
ZITAT(globetrotters1 @ Oct 28 2010, 18:58) *
So for the short signatures I check "in B " (with a space) or "in B," and replace it with H-Dur

The end of line situation is the problem... (before the file extension)

$ matches the end of a line, so check for "in B$"
you can also check for alternatives with "|". this would be perfect for you:

$regexp(%title%,in B($| |','),in H-Dur$1)



Problem 2:
Format the Title with this string:
$regexp(%title%,(.*?) - (.*?) - (.*),$1 - $if($eql(%_counter%,1),$2 - I,$replace(%_counter%,1,I,2,II,3,III,4,IV,5,V,6,VI,7,VII,8,VIII,9,IX,10,X)) - $3)

BUT: You can't format the whole album at one go. You have to do it separately for every Roman number sequence.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th November 2014 - 01:11