Jump to content

Changing text within a text field


This topic is 6550 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've been searching the forum and still can't find a solution to change the text with-in a text field.

Example: FLD Name( Desc) FLD contents( United States of America - Midwest Region)

I'd like to change the contents of Desc when it has (United States of America) to just plain ol (US) so the contents will now look like ( US - Midwest Region).

I've tried the Replace and Subsitute function with no luck..

Link to comment
Share on other sites

Hi Greg ...

Try:

Substitute(Desc, "United States of America", "US")

If you want to make this change to all your records, put it in a looping script.

Go To Record/Request [First]

Loop

Set Field [Desc, Substitute(Desc, "United States of America", "US")]

Go To Record/Request [Next, Exit after last]

End Loop

Link to comment
Share on other sites

Look into the Find/Replace script step too. I've just begun using it and like it, though it's not as fast IMHO as Set Field but it has other advantages...

The Set Field[] step will kill all character formatting in the text, whereas the Find/Replace step will not. However, Find/Replace is layout dependent (the fields need to be on the current layout when the command runs) but that's not too much of a trade-off.

Link to comment
Share on other sites

One thing you should be aware of is that Substitute is Case sensitive, so if it happens that your text was entered as UNITED STATES OF AMERICA, the substitute wouldn't work.

You'd then have to change it to Substitute(Proper(Text), "United States Of America";"USA")

My 2 cents

Link to comment
Share on other sites

This topic is 6550 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.