June 6, 200619 yr :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
June 6, 200619 yr 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, 200619 yr by Guest Fixed a bug to deal with name contained in surname
June 6, 200619 yr 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, 200619 yr by Guest
June 6, 200619 yr Author :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
June 6, 200619 yr 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
June 6, 200619 yr I have edited the calc slightly to fix a problem with cases where the name is contained in surname, such as IVANOVIvan.
June 7, 200619 yr Author :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
June 7, 200619 yr 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.
Create an account or sign in to comment