02-07-2015, 11:33 AM
I am trying to replace all occurences of a bracketed string with sometimes nothing and sometimes something else and I cannot work out how to refer to the brackets themselves (or how to select variable length text between).
An extract from one of the files (musicians) is:
Hall, Ben + Ruppersberg, Don + Robertson, Bill (trombone); Kinsey, Gene (alto sax); McCook, Don (alto sax, clarinet)
I want to reformat this as:
Hall, Ben + Ruppersberg, Don + Robertson, Bill; Kinsey, Gene; McCook, Don
I tried your excellent and elegant:
key Ca
Replace "xxx" "yyy" 0 1 1
and it works brilliantly for known text substitution, but I cannot get it to select the brackets.
So replace "trombone" with "guitar" works but replace "(trombone)" with "" - ie nothing - does not because it rejects the opening bracket "(".
And what I really want to do is replace the brackets "()" and all the text between each with nothing (or sometimes a constant text string).
All help gratefully received!
Terry
An extract from one of the files (musicians) is:
Hall, Ben + Ruppersberg, Don + Robertson, Bill (trombone); Kinsey, Gene (alto sax); McCook, Don (alto sax, clarinet)
I want to reformat this as:
Hall, Ben + Ruppersberg, Don + Robertson, Bill; Kinsey, Gene; McCook, Don
I tried your excellent and elegant:
key Ca
Replace "xxx" "yyy" 0 1 1
and it works brilliantly for known text substitution, but I cannot get it to select the brackets.
So replace "trombone" with "guitar" works but replace "(trombone)" with "" - ie nothing - does not because it rejects the opening bracket "(".
And what I really want to do is replace the brackets "()" and all the text between each with nothing (or sometimes a constant text string).
All help gratefully received!
Terry