1 Reply Latest reply on Sep 30, 2013 4:24 PM by philmodjunk

    How to get Address from a string

    SaiAlb

      Title

      How to get Address from a string

      Post

           How can I separate and get the Street, City, State, Zip Code and Country from a string that is in this format.?

      111 5TH ST # 111

      Los Angeles, CA 90010

      USA

      Thank you.

        • 1. Re: How to get Address from a string
          philmodjunk

               Assuming that your text example is text from a single field with returns producing the three rows shown....

               GetValue ( yourText ; 1 )

               will return the street name and number.

               Let ( CSZ = GetValue ( YourText ; 2 ) ;
                       Left ( CSZ ; Position ( CSZ ; "," ; 1 ; 1 ) - 1 )
                     )

               Will return the city

               Let ( CSZ = GetValue ( YourText ; 2 ) ;
                       LeftWords ( Right ( CSZ ; Length ( CSZ ) - Position ( CSZ ; "," ; 1 ; 1 ) ) ; 1 )
                     )

               Will return the state

               Let ( CSZ = GetValue ( YourText ; 2 ) ;
                       RightWords ( CSZ ; 1 )
                      )

               WIll return the zip and

               GetValue ( YourText ; 3 )

               Will return the country.