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

AccuZIP6 is the best product on the market. The tech support is great. Whenever I have a question, I get the straight answer. I always get through to tech support with no wait time. The program does it all. Not like so many other products that you have to buy add on products to.
P.F., Bedford, TX