May 29, 200916 yr Is there a way to search a text string for a list (value list?) of specific terms and replace them? Specifically: 1 - User entry - types text line 2 - Calc field with "Proper" function cleans text. 3 - Writes cleaned text to description field. . . . this part is running fine. The challenge is that we have some terms that need to be caps (ie. ABC, CBS, JVC, IBM, II, etc.) within the text string. Is it possible to have a running list of these terms that can be checked against? If found, it would replace only those letters with the all caps version. I would like to insert that function between 2 & 3. thanks,
May 29, 200916 yr It's possible, but it would require either a custom (recursive) function or a looping script, since each word needs to be processed individually. Another difficulty is to preserve punctuation marks.
May 29, 200916 yr I just tested the custom function Here and it seems to work. HTH Lee [color:red]ps I notice a small glitch in this CF, if you have any variations of abc, ibm, etc, it will need to be added to the list. i.e. Abc, or Ibm Edited May 29, 200916 yr by Guest ps
July 21, 200916 yr Author OK, I have been playing a bit, and have some success, but don't know how to check a single field through a list of 27 options. Here is what I have, and it works, but just for one option so far. field - what it does: desc_input - Simple text input desc_proper - calc value; Proper ( desc_input ) desc_CAPS - calc value; Substitute ( desc_proper_step ; "Ada" ; "ADA" ) It is working, takes the text from/to: maNy ada unitS Many Ada Units Many ADA Units This is what I want, but how do I add more options? I.E, IBM, CVS, EOA, etc. thanks
July 21, 200916 yr Author A partial list of options to check: "Ada" to "ADA" "Adw" to "ADW" "Aec" to "AEC" "Amb" to "AMB" "Efh" to "EFH" "Bi " to "BI " "BJ's" to "BJ's" "Pms" to "PMS" Thanks, the file is attached, I did it here using calc fields. Would there be any advantage if I did it in a script instead? proper_check.zip Edited July 21, 200916 yr by Guest added question
July 21, 200916 yr Agnès and Debi have toyed with this approach for quite a while: http://www.briandunning.com/cf/899 And it can be used like I show it in the attached template. --sd twowaystreat.zip
July 24, 200916 yr Author I ended up taking this idea and changing it to a script. I can now call it from multiple layouts as needed. thanks again.
Create an account or sign in to comment