Alpha Video Training
Results 1 to 3 of 3

Thread: Problem with address lines in one field

  1. #1
    Member
    Real Name
    Janet James
    Join Date
    Feb 2003
    Location
    London, UK
    Posts
    32

    Default Problem with address lines in one field

    I think I have an unsumountable problem! The guy who designed our website did it in Microsoft Access and he has the address data in one field. Now we want to compare things with our dear old Alpha program databases - we have Aplha4v8 and Alpha5v6 - but there is no way we can see to split up the addresses into separate lines, as the length of the address lines all vary (We are talking UK addresses). We have exported to an Exel spreadsheet, and the address lines show up one under the other in i.e.
    1 Egton Road
    Aislaby
    Whitby
    North Yorkshire
    When saving as an asc file or a dbf file, the lines are in one long string. In Alpha4v8 there is a marker between the lines, which we assume represents a carriage return. If we could replace the carriage return mark with a comma we might be getting somewhere, but we don't know how to do this.
    Any help would be gratefully appreciated.
    Regards,
    Janet

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Problem with address lines in one field

    Use the stritran() function as in

    string = "1 Egton Road " + crlf()+"Aislaby "+crlf()+"Whitby "+crlf()+"North Yorkshire "
    ? string
    = 1 Egton Road
    Aislaby
    Whitby
    North Yorkshire

    ? stritran(string,crlf(),",")
    = "1 Egton Road ,Aislaby ,Whitby ,North Yorkshire "

  3. #3
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default RE: Problem with address lines in one field

    Janet:
    What is your ulimate goal?

    If your ultimate goal is to simply have the address on multiple lines as opposed to on a single line, then Stan's suggestion should work just fine for you.

    On the other hand, if you wish to have the street in a separate field, the city in another field etc., then simply import these fields from Excel.

    There is one twist however; you say that in Excel "address lines show up one under the other" :
    Is each address contained in one cell only, with multiple line? if so you would have to use justify() first, if they are contained in multiple cells vertically, use transpose() to line up all streets in one column and all cities in another column etc.

    Alternatively, you could import the field as such (one line) and later break it down to multiple fields using an update operation and the substr() expression.
    Gabe

Similar Threads

  1. Avoiding Blank Address Lines
    By davidab in forum Alpha Five Version 6
    Replies: 2
    Last Post: 05-31-2005, 06:57 AM
  2. IP Address Field type
    By Thomas Dillingham in forum Archived Wishlist
    Replies: 1
    Last Post: 03-18-2005, 01:14 PM
  3. Lines on browse problem
    By joannristau in forum Alpha Five Version 5
    Replies: 4
    Last Post: 07-14-2004, 08:16 AM
  4. Sort by Address Field
    By Normand Paquette in forum Alpha Five Version 5
    Replies: 8
    Last Post: 04-04-2004, 08:22 AM
  5. blank address lines
    By C Johnson in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-29-2003, 05:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •