Insert Space in Full name

Build your list of AccuZIP6 commands by requesting commands and sharing commands with other users

Moderators: Chrissy, Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Geoff, Vince

Post Reply
User avatar
Eric
Moderator
Posts: 1910
Joined: Tue Sep 19, 2006 3:29 pm
Contact:

Insert Space in Full name

Post by Eric » Wed Aug 12, 2009 10:28 am

This command will take a name in the field called First that is formatted like this:
JohnSmith
(where the first and last name are together without a space and the last name has a capital letter)

and make it: John Smith

With your name in the field called first, pull down the Edit menu to Command, then run the command below:

Code: Select all

com_Char=65
com_Field="FIRST"
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
com_Char=com_Char+1
REPLACE &com_Field WITH LEFT(&com_Field,1)+STUFF(SUBSTR(&com_Field,2),AT(CHR(com_Char),SUBSTR(&com_Field,2)),0," ") ;
	FOR AT(CHR(com_Char),SUBSTR(&com_Field,2))>0
REPLACE ALL &com_Field with REDUCE(&com_Field)
Chat with an AccuZIP6 technician weekdays from 7-4 PST with AccuZIP6 Live Online Support

Post Reply