Support 805.461.7300
Sales
Our Technology. Your Success.

Separate Address and Address2 when they're in the same field and boxes are in between

Description

In some Excel files, the address2 information will appear in the same column as the address, separated by a return. When you open the file in AccuZIP6, it will show the address and address2 information in the address field, with a box or two boxes in between. The command below creates a field named address2, strips out the boxes, and moves the address2 information into the address2 field.

The Command

ALTER TABLE ALIAS() ADD COLUMN ADDRESS2 C(60)
Replace all address with STRTRAN(address,CHR(13),"@")
Replace all address with STRTRAN(address,CHR(10),"@")
Replace all address with STRTRAN(address,"@@","@")
Replace address2 with ltrim(substr(address,at("@",alltrim(address))+1)), address with left(address,at("@",alltrim(address))-1) for occur("@",alltrim(address))>0

If you already have a field named Address2 in your database, you can delete the first line of the command, then run it. After running the command, everything to the right of the boxes will be moved into the field named address2, and the boxes will be removed from the address field.

« Back to Commands

I appreciate [AccuZIP support technician] Geoff! He has over and over with a positive attitude given us exceptional support. He is a key asset to us and we are so thankful for him. I just wanted to let you all know that he has so much patience and knowledge. I am sure you know but he is a KEEPER for your company.
K.P., Colorado Springs, CO