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
> Using "[]" as brackets in a regular expression
MyAlteredEgo
post Aug 10 2017, 03:29
Post #1


Member


Group: Full Members
Posts: 54
Joined: 3-January 17
Member No.: 22893
Mp3tag Version: 2.80



Am trying to re-organize my music folder and would like to header each letter (eg. [A] Artists, [B] Artists, etc). I have been able to use $validate($replace(F:\F PreInbox\$left('[%albumartist%,1]')\%albumartist%\%album% $num(%year%,4), , ), %mediatype%,'_') which gives me the structure I want minus the "[]" .. I have been playing around with the positioning of the '[ and the ]' but have yet to get it correct....any assistance would be appreciated.

Go to the top of the page
 
+Quote Post
MyAlteredEgo
post Aug 10 2017, 04:11
Post #2


Member


Group: Full Members
Posts: 54
Joined: 3-January 17
Member No.: 22893
Mp3tag Version: 2.80



QUOTE (MyAlteredEgo @ Aug 10 2017, 04:29) *
Am trying to re-organize my music folder and would like to header each letter (eg. [A] Artists, [B] Artists, etc). I have been able to use $validate($replace(F:\F PreInbox\$left('[%albumartist%,1]')\%albumartist%\%album% $num(%year%,4), , ), %mediatype%,'_') which gives me the structure I want minus the "[]" .. I have been playing around with the positioning of the '[ and the ]' but have yet to get it correct....any assistance would be appreciated.


Ok my error, this isn't in a regular expression however the question still remains. Would also like to try to figure out if I can set up after processing via some if not all of BPM processing, KeyFinder and Album Art Downloader where I can move the folder(s) that I just processed (if in already in the order I wanted) directly to my Media/Music Folder bypassing the Pre Inbox folder?
Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 10 2017, 06:19
Post #3


Member


Group: Full Members
Posts: 9137
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.84d



The square brackets serve as some kind of "if" statement: if there is nothing in the named field variable don't ouput the text in brackets - a text option.
If you want to get the brackets as literals, you have to use '[' and ']' like '['%year%']'.


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
MyAlteredEgo
post Aug 10 2017, 13:04
Post #4


Member


Group: Full Members
Posts: 54
Joined: 3-January 17
Member No.: 22893
Mp3tag Version: 2.80



QUOTE (ohrenkino @ Aug 10 2017, 07:19) *
The square brackets serve as some kind of "if" statement: if there is nothing in the named field variable don't ouput the text in brackets - a text option.
If you want to get the brackets as literals, you have to use '[' and ']' like '['%year%']'.

Thank you for the response from looking at your example, I was missing the extra ' . I only had '[%year]' ....
Go to the top of the page
 
+Quote Post
MyAlteredEgo
post Aug 12 2017, 16:54
Post #5


Member


Group: Full Members
Posts: 54
Joined: 3-January 17
Member No.: 22893
Mp3tag Version: 2.80



QUOTE (MyAlteredEgo @ Aug 10 2017, 14:04) *
Thank you for the response from looking at your example, I was missing the extra ' . I only had '[%year]' ....



Ok so I am still having positioning issues even though I have followed the above

$validate($replace(F:\F PreInbox\$left('['%albumartist%,1']')\%albumartist%\%album% $num(%year%,4), , ), %mediatype%,'_')

Is not working the way that I am trying to get it to do....just where should these brackets be placed for my desired results as I have moved them around and still have not been able to get it to work properly..the assistance is greatly appreciated.
Go to the top of the page
 
+Quote Post
poster
post Aug 12 2017, 17:27
Post #6


Member


Group: Full Members
Posts: 1401
Joined: 22-March 09
Member No.: 9241
Mp3tag Version: 2.84e



What about:
QUELLTEXT
'['$left(%albumartist%,1)']'
Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 12 2017, 18:08
Post #7


Member


Group: Full Members
Posts: 9137
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.84d



You can test your expression with the function Convert>Teg-Tag.

$left('['%albumartist%,1)']'

would always return the [ as this is the first character from the left.


--------------------
42 - wie war die Frage / what was the question / quelle était la question
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: 20th October 2017 - 13:27