Newbies PrePressExpress Posted June 7, 2010 Newbies Posted June 7, 2010 Hi, Im trying to substitute the lower case letter i for the uppercase letter I in a text field. But i only want the letters to be substituted when the letter i is by itself and not in another word. Here is an example: Before: "Hi my name is Ian, i want to substitute text." After: "Hi my name is Ian, I want to substitute text." This is for an email field that will change when a user enters the text manually. I hope that makes sense. Thanks, Ian
Lee Smith Posted June 7, 2010 Posted June 7, 2010 (edited) If I'm understanding you correctly, To change the lowercase i to a capital, you can do this using the Substitute Function Substitute (yourField; " i "; " I ") HTH Lee BTW, You can use this on the field directly using the Auto Enter by Calculation, and deselecting the "do not replace..... " Edited June 7, 2010 by Guest
LaRetta Posted June 7, 2010 Posted June 7, 2010 (edited) As Lee suggests, Substitute() is probably the way to go here. You could use something like: Substitute ( text ; [" i " ; " I " ] ; [" i." ; " I." ] ; [" i," ; " I," ] ; [ " i'l" ; " I'l" ] ; [ " i'm" ; " I'm" ] ; [ " i'd" ; " I'd" ] ; [color:green][ "i'd " ; "I'd " ] ; [ "i'l " ; "I'l " ] ; [ "i'm " ; "I'm " ] ) Edited June 7, 2010 by Guest Added green. Did I miss any? There are probably more clever ways too.
Raybaudi Posted June 7, 2010 Posted June 7, 2010 Hi all there is even another way but it isn't a calculation: it is a script step to add to a button or to fire with an Event plug-in ( if you are really on 9 ) or with a trigger OnObjectExit: Perform Find/Replace [ No dialog; "i" ; "I" ; Replace All ( Direction: All ; Match case ; Match whole words only ; Search across: Current record ; Search within: Current field ) ]
Lee Smith Posted June 7, 2010 Posted June 7, 2010 Hi Daniele, The Replace will change every occurrence of the letter i. Ian was asking to change it only when it was used as a pronoun. Lee
Lee Smith Posted June 7, 2010 Posted June 7, 2010 (edited) Hi Daniele, I have never used the script step for find and replace, my habit is to use the Substitute Function, or the Menu Replace. I learned something new today. Thanks for pointing this out. Lee Edited June 7, 2010 by Guest
LaRetta Posted June 7, 2010 Posted June 7, 2010 (edited) Thanks, Daniele. I admit that I don't use Perform Find/Replace often; in fact, I've only used it a dozen times in several years. Thanks for the reminder that it should remain in our toolkits. :smile2: Edited June 7, 2010 by Guest
Raybaudi Posted June 7, 2010 Posted June 7, 2010 I think that that script step must be revaluated mostly now that we have those beautifull triggers :)
Newbies PrePressExpress Posted June 8, 2010 Author Newbies Posted June 8, 2010 Hi LaRetta and All, Thanks so much for the fast responses. Your code is exactly what i was looking for. It was the spaces that i forgot in my substitute code when i had wrote it. Something to add to my what not to do list. Thanks for all of the help!!! Best regards, Ian
Recommended Posts
This topic is 5352 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