Montana50 Posted August 28, 2015 Posted August 28, 2015 For some fields I use the Proper() function to return the first letter of each word as uppercase, and that works. Only, when there is "sa de cv" at the end of the text (all upper case or mixed), it should be/stay as "sa de cv". Is there a clever calc to put the text in Proper(), except that part, that has to be all in lower case ? I tried several combinations Proper()/Lower()/Substitute with no success, except knowing what is not working. So it is not all wasted time....
comment Posted August 28, 2015 Posted August 28, 2015 How about: Substitute ( Proper ( text ) & "§" ; [ "Sa De Cv§" ; "sa de cv" ] ; [ "§" ; "" ] )
Montana50 Posted August 28, 2015 Author Posted August 28, 2015 Thanks Comment. I stumbled over some other forms of "writing". S. A. DE C. V. and S.A de C.V. (and some other weird combinations) I suppose I have to add a Substitute part as: [ "S. A. DE C. V.§" ; "sa de cv" ] ; [ "§" ; "" ] to make it work ?
comment Posted August 28, 2015 Posted August 28, 2015 No, you'll have to make it: Substitute ( Proper ( text ) & "§" ; [ "Sa De Cv§" ; "sa de cv" ] ; [ "S. A. De C. V.§" ; "sa de cv" ] ; [ "S.a De C.v.§" ; "sa de cv" ] ; [ "§" ; "" ] ) Note that Substitute() is case-sensitive, so in order to save on substitution pairs it's better to do the Proper() part first. This means that any "weird combination" you want to add needs to be added in its Proper form: "S. A. DE C. V." --> "S. A. De C. V." and "S.A de C.V." --> "S.a De C.v.".
Montana50 Posted August 28, 2015 Author Posted August 28, 2015 Now I understand. (the FM Help is not very clear about this) Thanks Comment, I appreciate.
Montana50 Posted August 28, 2015 Author Posted August 28, 2015 Oh shoot !! Even a space as last character gives problems. So the Trim() function has to come before the Proper. First Trim (remove not needed spaces) then Proper, then Substitute all weird combinations
Recommended Posts
This topic is 3444 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