Support 805.461.7300
Sales
Our Technology. Your Success.

Move first word in a field to the end of the field or to another field

The following command will take the first word in a field and move it to the end of the field.

EXAMPLE:
Smith John and Tracy
will change to:
John and Tracy Smith
and
Smith John
will change to
John Smith

Replace first with substr(ALLT(first),at(" ",alltrim(first))+1)+" "+left(first,at(" ",alltrim(first))-1) for occur(" ",alltrim(first))>0

The command below moves the first word out of the field called First and puts it into the field named Last, and leaves everything else in the First field:

Replace last with left(first,at(" ",alltrim(first))-1),first with SUBSTR(first,at(" ",ALLT(first))+1) for occur(" ",alltrim(first))>0

If you have a comma immediately after the first word, then run this command instead:

Replace last with left(first,at(" ",alltrim(first))-2),first with SUBSTR(first,at(" ",ALLT(first))+1) for occur(" ",alltrim(first))>0

« Back to Commands

Your Mr. Vince Murdoch, who I was directed to contact, was very helpful in walking me through your software. Vince was very patient with me even though I am a very small customer in your scheme of things. You have a courteous and patient tech support professional in Mr Vince Murdoch. I needed his help even though I have been doing bulk mailing for 25 years.
K.V., , Pittsburgh, PA