cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing multiple strings within a field

former_member1110314
Participant
0 Kudos

Hi there

I want to replace certain strings in a field with an italicised alternative. I've got the Italics working, but it seems that Crystal doesn't want to do it more than once per record.

I am attaching a screenshot of the formula I'm using and also the output that I am getting. You will see that only one of the values is being replaced as required. This is an example of only two of the output label blocks, representing two records.

Does anyone know how I can set up my replace formula so that all of the required replacements can be done for each record?

thanks

Karen

italicreplacementformula.jpgitalicreplacementoutput.jpg

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

You are probably doing multiple replace attempts on the original data. So only the last replace attempt can have any impact.
Instead, load the first replace result into a string variable, and target that result variable for all future replace attempts.

Answers (1)

Answers (1)

former_member1110314
Participant
0 Kudos

Another note:

One thing I am about to try is to simply replace all the relevant values in the data with HTML italics tags, with the field set to HTML format... hopefully that will do away with the whole formula problem altogether.. watch this space.

cheers

Karen

former_member1110314
Participant
0 Kudos

Problem solved! I just tagged the requested strings with HTML italic tags and formatted the field as HTML.... et voila!

This is not ideal under normal circumstances, because we wouldn't want HTML tags in our normal data, but this data is for a special project, so this is the best solution!

cheers

Karen