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

We have partnered with AccuZIP for several years, and they clearly are the best. The software is second to none and what is even better is the support they offer. Their team provides the best customer service and they are able to help us with every challenge and question we have asked. We all know that the mailing and USPS guidelines can be complex, but with AccuZIP we have a competitive edge against our competition. If you want to succeed in direct and EDDM mailing, go with the best strategic partner in the business, AccuZIP!
J.P., Bradenton, FL