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
> Regex Required: SPACE • DOT
ragtag
post Jan 11 2018, 13:09
Post #1


Member


Group: Full Members
Posts: 79
Joined: 16-February 13
Member No.: 17578
Mp3tag Version: 2.84a



When tagging multiple-disc albums, I usually let Mp3tag fetch the album name (or a portion thereof) from the %_directory% field, using the Format Value Action. The album name then may look something like this:

"The Ultimate Classical Album . CD1. Relax At Home"

The latter portion of the preceding album name i.e. "CD1. Relax At Home", is derived from %_directory%.

Now, I need to format this particular album field with the Mp3 tagging tools at hand, so that that the second DOT in the album field-- the one which follows directly after the CD-number, is preceded with a space. It should then look like this:

"The Ultimate Classical Album . CD1 . Relax At Home"

Could you please assist me with a regular expression, or another scripting function that will take care of this?

Your assistance is always greatly appreciated.
Go to the top of the page
 
+Quote Post
stevehero
post Jan 11 2018, 14:21
Post #2


Member


Group: Full Members
Posts: 855
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.84



QUOTE (ragtag @ Jan 11 2018, 13:09) *
"The Ultimate Classical Album . CD1. Relax At Home"

Breaking it down into captures.

To match The Ultimate Classical Album . CD1. Relax At Home


CODE
(?i)^(.+?[^\s])\s*\.\s*cd(\d+)\s*\.\s*(.+)



Then $1 will represent the first part
CD$2 the CD with no.
$3 the final part.

You can keep the same reg exp. Just fill in the format with section with whatever you want with either using the $1 $2 or $3.

EDIT I went a little overboard. w00t.gif

Your task can use the same expression.
CODE
(?i)^(.+?[^\s])\s*\.\s*cd(\d+)\s*\.\s*(.+)


Then use:
CODE
$1 . CD$2 . $3


In the replace with in the reg exp action.

Like I said it's overboard but you might learn something from this. But it will ensure that you've got the correct format in all your cases smile.gif

This post has been edited by stevehero: Jan 11 2018, 14:35


--------------------
Go to the top of the page
 
+Quote Post
ohrenkino
post Jan 11 2018, 14:23
Post #3


Member


Group: Full Members
Posts: 9472
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.85k



Why don't you
replace all dots with blank-dot-blank in a first plain replace action and then
replace all double-blanks with a single blank in the next plain replace action. Done.


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
ragtag
post Jan 11 2018, 18:41
Post #4


Member


Group: Full Members
Posts: 79
Joined: 16-February 13
Member No.: 17578
Mp3tag Version: 2.84a



Thank you to you both, stevehero and ohrenkino, for your quick responses.

Before I submitted my original post, I was already employing exactly the method proposed here by ohrenkino, but I thought there was an even quicker method. tongue.gif

Stevehero, I am going to experiment with your proposal as well. When you went "overboard" biggrin.gif in the beginning, it scared the wits out of me, but your final final expression may just save me step or two.

Thanks again!
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: 19th January 2018 - 19:59