Condensing redundant text

This seems like a simple task, but I haven’t been able to find a solution. In the following example, there is redundant text (“2000 Universal Music (Denmark) A/S” appears twice):

℗ 2000 Universal Music (Denmark) A/S © 2000 Universal Music (Denmark) A/S. A Universal Music Company

I would like to automatically condense this to:

℗ & © 2000 Universal Music (Denmark) A/S. A Universal Music Company

I feel like the following formulas would be involved, but I’m not sure if they could be combined to accomplish it, or if there’s another solution:

  • $regexp(x,e,r,c)

  • $eql(x,y)

  • $if(x,y,z)

Thanks!

I put the text into the field COMMENT
$if($eql($regexp(%comment%,℗ (.*) © (.*)\. (.*),$1),$regexp(%comment%,℗ (.*) © (.*)\. (.*),$2)),$regexp(%comment%,℗ (.*) © (.*)\. (.*),℗ & © $1. $3),%comment%)

You would have to replace %comment% with the real field name.

I was able to accomplish it with (an adaption of your code):

$if($eql($regexp(%copyright%,℗ (.*) © (.*),$1),$regexp(%copyright%,℗ (.*) © (.*),$2)),$regexp(%copyright%,℗ (.*) © (.*),℗ & © $1),%copyright%)

Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.