GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Staff
Posts: 50
Registered: ‎01-25-2019

Extract first letter characters

Hi - 

 

I have a list of postcodes polygons, with the postcode attribute such as AB12ABC, AB32CDA and A12ABC, A56DFH.  I am using Analytical Merge on All AB  and  A postcode polygons, outputting geometry and I want to also output the postcode area, being AB & A in this case. 

 

Is there a functional attribute that will extract the first letter characters from the text string?  So will extract up to the first instance of a number character. This could be a single letter pair or single letter character. 

 

For my case, i have a simple work around, but am interested in this anyway. Thanks

Highlighted
Regular Contributor
Posts: 226
Registered: ‎05-25-2016
Highlighted
Staff
Posts: 50
Registered: ‎01-25-2019

Re: Extract first letter characters

Thanks @hesrah however as I have differing letter characters and differening lengths of letter characters, the LEFT, RIGHT, SEARCH, TRIM, FIND, etc won't return the required characters.

Further examples of the postcodes are

AB123ABC

BA123ABC

A123ABC

B123ABC

CA123ABC

CA1223ABC

DB3221CBA

Highlighted
New Contributor
Posts: 4
Registered: ‎04-02-2018

Re: Extract first letter characters

[ Edited ]

You can use the SEARCH function to look for the first number (part of collection [1234567890]).

 

The complete function would than be:
LEFT(input.ZIPcode, SEARCH('[1234567890]',input.ZIPcode,1)-1)

 

Does this answer the question?