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
> Information from directory name to tag, Can't get year from parent directory name
Mihey
post Jan 19 2008, 13:50
Post #1


Member


Group: Full Members
Posts: 6
Joined: 8-October 05
Member No.: 2215
Mp3tag Version: 2.39



Hi,

I have a bunch of mp3s with empty YEAR tag, but each of the singles is contained in "Artist - Year - Title" folder. How do I extract the year from it into the YEAR tag?

By the way, I tried Actions, particularly Replace with regular expression. I matched the empty field and used scripting function in "replace with":

CODE
$regexp(%_directory%,.+\s-\s(\d+)\s-\s.+,$1)


But it seems not to recognize "%_directory%" as a placeholder for parent directory (YEAR = "%_directory%"). I couldn't find a list of placeholders to be used in scripting functions and took this one from Columns. M-m, was that wrong?
Go to the top of the page
 
+Quote Post
dano
post Jan 19 2008, 15:04
Post #2


Moderator


Group: Moderators
Posts: 5680
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.61d



You are probably using the Replace with regular expression action in a wrong way and you should use a different action type.

You can try Format value
Field: YEAR
Format string: $regexp(%_directory%,.+\s-\s(\d+)\s-\s.+,$1)

or Import value
Guessing pattern: %_directory%
Format string: %dummy% - %year% - %dummy%


--------------------
Go to the top of the page
 
+Quote Post
Mihey
post Jan 20 2008, 11:23
Post #3


Member


Group: Full Members
Posts: 6
Joined: 8-October 05
Member No.: 2215
Mp3tag Version: 2.39



I used the first suggestion and it worked. Thanks!
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: 30th July 2014 - 06:01