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

Prior to Accuzip we used SAP Postalsoft. We looked for its replacement and chose Accuzip based on testimonials of how great customer service was and on pricing which was very attractive. Best move we've ever made in software and you folks live up to all the good things I heard. I still get calls every 6 months from FirstLogic ( a distributer of the old Postalsoft and others) to see if I'm still happy with Accuzip. I always say the same thing: Yes, very happy. Thanks for checking in.
B.H., Newtown, PA