mikeytt Posted March 21, 2006 Posted March 21, 2006 What sort of calculation can i use to check if the last WORD (rightword, 1) of a text field, is made up of just numbers. This is to be used to extract zipcodes from address lines. Generally, the address line field runs as follows: add1, add2, city, state zip but on occasions, the zip and state are reversed, or the country has also been added to the end. I therefore need to be able to check if the last word (or indeed whatever selection of text i pull out) contains just numbers - if so I can therefore identify it as a zipcode and copy it off into another field.
aaa Posted March 21, 2006 Posted March 21, 2006 Hi, mikeyt! Can you attach part of your file here for showing how it looks?
mikeytt Posted March 21, 2006 Author Posted March 21, 2006 I've actually found a workaround now, by just checking if the first character of the words are numerical, but i would still be interested to know if there is way to check if a text range is numerical, or alphabetical. No file as such, but example of some text fields below 411 East Palm Canyon Drive, Palm Springs, California 92264 Olive Avenue, Rehoboth Beach, Delaware 19971 125 Canyon Circle Drive, Sedona, Arizona 86351, USA 10529 Main Street, Clarence, New York 14031–1684 So, if i set up a field to extract the last word bu calculation, is there a way to check if that last word is made up entirely out of numericals (0123456789) or if it is alphabetical characters, bearing in mid that it may not have a fixed width (ie not always 5 characters)
comment Posted March 21, 2006 Posted March 21, 2006 Try: Let ( word = RightWords ( Address ; 1 ) ; Exact ( word ; Filter ( word ; "0123456789" ) ) )
mikeytt Posted March 21, 2006 Author Posted March 21, 2006 Perfect - thanks ever so much, it works. Never used LET function before, but it is very interesting what you can do with it.
Recommended Posts
This topic is 6884 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now