ino Posted June 6, 2006 Posted June 6, 2006 :bang: How to split one space in SURNAMEName field which is not spitted? Have a problem in database. I have lot of records with people surname & name bat in format: SURNAMEName MATICMato MIKICMirko NODILOIvan RUBESAAleksndar KALINICIvan PRSODado and so on ... [color:red]not spitted. I try out and try out bat don’t find the way to split them in format SURNAME Name. Only [color:blue]INDICATOR which I have is that all SURNAME characters are UPPER LETERS (uppercase) and Name characters only first letter is uppercase. Need suggestion how to split this field that [color:red]between SURNAME and Name i get (put) [color:red]one space (that field look like): SURNAME Name. MATIC Mato MIKIC Mirko NODIL OIvan RUBESA Aleksndar KALINIC Ivan PRSO Dado and so on ... (calculation, Custom function, Script or : ) Platform OS x 10.4.6 fmp 8.03 Thanks in advance :qwery: INO
comment Posted June 6, 2006 Posted June 6, 2006 (edited) Try: Let ( [ newText = text & "§" ; lowerPart = Filter ( newText ; "abcdefhijklmnopqrstuvwxyz§" ) ; pos = Position ( newText ; lowerPart ; 1 ; 1 ) - 2 ; surname = Proper ( Left ( text ; pos ) ) ; name = Right ( text ; Length ( text ) - pos ) ] ; surname & " " & name ) Edited June 6, 2006 by Guest Fixed a bug to deal with name contained in surname
Lee Smith Posted June 6, 2006 Posted June 6, 2006 (edited) Very nice calculation comment. I think that the only change that INO needs to make is to change the Proper to UPPER to get what he asked for. Lee Edited June 6, 2006 by Guest
ino Posted June 6, 2006 Author Posted June 6, 2006 :worship: comment WORKS ...! thanks a lot Ino Lee, I try to do that, but problem is in first letter in Name (MARICMarko), because in that case only first letter in field is Uppercase,means that also in Name all letters are lowercase (Maricmarko ) but any how comment solved my problem. bestR. :hello: Ino
Lee Smith Posted June 6, 2006 Posted June 6, 2006 Hi INO, Glad you're happy. I just wanted to confirm that we were talking apples and apples here. this Calculation Let ( [ lowerPart = Filter ( FullName ; "abcdefhijklmnopqrstuvwxyz" ) ; pos = Position ( FullName ; lowerPart ; 1 ; 1 ) - 2 ; surname = [color:blue]Upper ( Left ( FullName ; pos ) ) ; name = Right ( FullName ; Length ( FullName ) - pos ) ] ; surname & " " & name ) Produces this MARIC Marko instead of Maric Marko Lee
comment Posted June 6, 2006 Posted June 6, 2006 I have edited the calc slightly to fix a problem with cases where the name is contained in surname, such as IVANOVIvan.
ino Posted June 7, 2006 Author Posted June 7, 2006 :thumbup: Hi Lee, once again Thank you for + support. When I try to solve the problem I try to use Upper and Lower format and as your replay was I understood that you mean on that. Normally when I solve the problem with comment suggestion (calc) I exactly do what you suggest. Thanks for as usual your care Ino
comment Posted June 7, 2006 Posted June 7, 2006 Well, your surnames already ARE in upper case. So if you want to keep them that way, all you need to do is remove the Proper() part in the surname definition.
Recommended Posts
This topic is 6743 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