Hi, this is my first post so please understand if I don't get it right.
In some files the TITLE is too long and I want to remove part of it. I understand how to remove a part from the beginning or the end, but how to remove something from the middle?
For instance (this is a fictive example)
Mozart - Pianoconcerto Nr. 25 (revised by Salieri) in E major, part 1 allegretto
I want to remove
(revised by Salieri)
in each of the tile tags.
Sorry, but I still don't quite understand.
When I put this in tag to tag nothing changes, but I presume I need to puit something between the brackets?
Don't understand what all this stands for: \(.*\) ,)
What would that be?
As Convert>Tag-Tag has a preview, you should see the immediate result, here: the string without that part in the brackets.
Also, as you can see the input field in the dialogue is labelled "Format string".
You copy and paste the string that I suggested into that field.
Now, a regular expression leads to no result (here: the string stays as it is) if the pattern does not match. So instead of giving
it would be better so see a real life string.
To see more about regular expressions, see the help:
There is, of course, the way to replace a string constant with nothing, e.g. with an action of the type "Replace" for TITLE
Search string: (revised by Salieri)
This works only for this exact string. if you have versions with "(revised by Clementi)" then it would not work - the regular expression would cater for both cases.
Thank you for your patience. Although I am an experienced above average computer user I know nothing about scripting. I still cannot make sense of it, I am too stupid for this and need an explanation for a 3-year old.
I go to Conversion Tag-Tag
In the dialogue box upper line I see TITLE
In the second line I put $regexp(%title%,\(.*\) ,)
But in the preview of the title underneath nothing changes. I guess I nee to put "revised by Salieri" somewhere in the second line?
As I said: the target string looks like the original string if the pattern cannot find a match in the original string.
If you want to go withoug pattern but with a string constant, then use the second option: a simple replace.
Or, and this has been suggested also already:
A string like
"Mozart - Pianoconcerto Nr. 25(revised by Salieri)in E major, part 1 allegretto"
would not match.
Or any other string where you don't find the pattern "opening bracket, any text, closing bracket, space"
I finally found the solution in alt-6, replace. It takes a bit more time because the part I want to replace it not the same everywhere, to give position numbers in the string would be easier, but it works. Thanks for all your trouble.
This is most likely not true if you have varying strings.
In the examples that you provided, the first string started at position 28 and in the second in position 23 ...
Anyway, you ware free to experiment and you may like to have look at the scripting functions esp. for strings.
See the help:
perhaps with a close look at $left(), $right(), $mid()
Thanks again. I will find my way eventually as I have in the past for other things. The last link is very helpful.
The string part I want to remove is usually the same number of characters, but the characters are different.
Perhaps this is sobering:
"in B minor, BWV 1067:" = 21 characters,
" (revised by Salieri)" = 20 characters.
Still I don't get it how you want to cut a certain number of characters from a string if you don't know where to start ...