Greg-SSG Posted February 16, 2004 Posted February 16, 2004 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..
-Queue- Posted February 16, 2004 Posted February 16, 2004 Create a calculation field with Substitute( Desc, "United States of America", "US" ). Display this field instead of the Desc one.
Jim McKee Posted February 16, 2004 Posted February 16, 2004 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
Vaughan Posted February 16, 2004 Posted February 16, 2004 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.
Greg-SSG Posted February 16, 2004 Author Posted February 16, 2004 Queue and Jim, Thats for the help. I'm still a novice and learning. I was close but missed the set field part. Thanks Greg
Ugo DI LUCA Posted February 16, 2004 Posted February 16, 2004 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
Recommended Posts
This topic is 7655 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 accountSign in
Already have an account? Sign in here.
Sign In Now