If possible, how do I export only a portion of the description in a tag field to another field? The string I wish to export is continuous, but it may vary in the number of characters and its position within the tag field- mostly the position will be at the beginning or at the end of the tag field.
A typical example would be where I would like to export the Composer of a song from the Title Field and move or copy it to the Composer Field. Here are two titles with the Composer at the beginning of the title, but it could be positioned anywhere else.
Verdi: Preludio Atto I (La Traviata)
Mozart: Madamina, Il Catalogo E Questo (Don Giovanni)
I have applied your proposal DetlevD, and it worked just fine in this particular instance. However, what if there are no discernible characters available in the field, for example no punctuation marks such as the colon after the name of the composer? Example:
Verdi Preludio Atto I (La Traviata)
Mozart Madamina, Il Catalogo E Questo (Don Giovanni)
You have different options to "repair" this initial situation ...
Use as the first split point the space character behind the artist name "Verdi".
Action "Guess values"
Source format: %TITLE%
Guessing pattern: %COMPOSER% %DUMMY%
This works for one word composer names only.
At first rename "Verdi" to "Verdi:" ... or something alike, ... then guess values ...
Action "Guess values"
Source format: $replace(%TITLE%,'Verdi ','Verdi:')
Guessing pattern: %COMPOSER%:%DUMMY%
There might be other textual tricks possible ...
Action "Guess values"
Source format: $replace(%TITLE%,'Verdi ',':Verdi:')
Guessing pattern: %DUMMY%:%COMPOSER%:%DUMMY%
Thank you DetlevD. Will a regular expression not achieve what I need to do? If there is a way to build to a regular expression to cover most instances of what I need to do, I will surely appreciate a few working examples.
Yes, you have to describe and lay out all different cases, in order to create and get at last an universal regular expression, if ever possible.
I assume that the basic problem remains the same, ...
which is the need of having distinct separator characters, ...
or systematically structured string data, ...
to describe where to split resp. what to extract.
See also links in post #2 above.
How do I move the name "Verdi" in the beginning of the field to the end of the same field, and if "Verdi" was at the end, how do I move it to the front?
Thank you once again, DetlevD, you have once again saved the day. I did try to figure it out on my own before your response, but I failed miserably at it. Cheers.
I experimented on my own to rearrange the TITLE description, but I failed to adapt your examples to get the desired result. Using our previous example, I would like to rename it thus:
TITLE = Verdi: Preludio Atto I (La Traviata) to:
TITLE = Preludio Atto I (La Traviata) {Verdi}
My best effort delivered this result:
TITLE = Preludio Atto I (La Traviata){} Verdi
I think that the the "Guess values" action is not always the best to manipulate one field.
For your example I could think of at least 2 approaches.
One uses the "Guess values" again but moves the "Verdi" to composer first:
Guess value for TITLE:
Guessing pattern: %composer%: %title%
and next perform an action of the type "Format value" for TITLE:
Format string: %title% {%composer%}
Alternatively, you could do without filling composer and move the part in front of the colon to the parenthesis:
"Replace with regular expression" for TITLE
Search string: (.): (.)
Replace string: $2 {$1}
If you want to transform one pattern into
The basic rule is ... divide a complex task into several steps of less complexity.
Once the text ...
"Verdi: Preludio Atto I (La Traviata)"
has been converted to ...
"Preludio Atto I (La Traviata), Verdi"
by the "guess values" proposal ...
then format the composer name ... from ", Verdi" to " {Verdi}".
This can be done for this special case by ...
Action: Format valueField : TITLEFormatstring:$replace(%TITLE%,', Verdi',' {Verdi}')
... or more general ... using a regular expression ...
Action: Format valueField : TITLEFormatstring:$regexp(%TITLE%,',\s*(.+?)$',' {$1}')
DD.20150721.2006.CEST
If you want to do it all in one go, then try the following regular expression ...
Yes and no: that is a leftover from a former idea and apparently I did not scroll to the end before I clicked send.
So in short: thanks but please ignore that sentence.