Insert characters in specific positions at tag fields


#1

Hi,

I'm trying to insert the ":" character in comment field in some specific positions (after the 10th and 15th letter from the beginning and the end of the text). After searching (/t/967/5 the only thing that come is how to insert at the end (appending).

Do you have any idea on how to do that??

Thanks

PD: It would be nice to learn how to insert a string of characters also at specific positions, or after some characters.


#2

Get yourself aquainted with the scripting functions $LEFT, $MID, $RIGHT, $LEN
Use these functions in an action of the type "Format tag field".

To insert a : at position 11 in TITLE use this construction:
$left(%title%,10):%mid(%title%,10,$len(%title%))

For "inserting after some characters" you could use the action "Replace with regular expression" - but for this it is necessary that that "character" is part of a unique pattern.


#3

Use action "Format value".

Three steps ... $left(%COMMENT%,10)':'$cutLeft(%COMMENT%,10) From: 0123456789abcdefghikABCDEFGHIK To : 0123456789:abcdefghikABCDEFGHIK $left(%COMMENT%,16)':'$cutLeft(%COMMENT%,16) From: 0123456789:abcdefghikABCDEFGHIK To : 0123456789:abcde:fghikABCDEFGHIK %COMMENT%':' From: 0123456789:abcde:fghikABCDEFGHIK To : 0123456789:abcde:fghikABCDEFGHIK: One step ... $mid(%COMMENT%,1,10)':'$mid(%COMMENT%,11,5)':'$mid(%COMMENT%,16,$sub($len(%COMMENT%),15))':' From: 0123456789abcdefghikABCDEFGHIK To : 0123456789:abcde:fghikABCDEFGHIK:

Beside the shown fundamental string manipulations you can choose the fitting string function for your problem out of a set of string functions.
The functions $replace and $regexp are often used too.
See Mp3tag manual "Scripting Functions".

DD.20121005.1030.CEST


#4

OK, Thank you, I get it.

I have another question, but as it is different, I'll create a new topic.