|
I have done code similar in the past in different languages. Here is what I did in pseudo code: 1) Trim the input getting rid of extra spaces on the beginning and the end. If the length of the resulting string is 0, throw this record as an exception 2) get the position of the last space in the field Move the field into a holding variable Do while scan position is not 0 Scan for space. If not 0 Grab text from this position to end of file as holding variable 3) We should now have the zip code in our holding variable. Try to validate it. It should be in 9999 format or 9999-9999 format. If not, throw this record as an exception. It could be a Canadian postal code, or European or some other country. Regards, Jim Langston Programmer/Analyst Cels Enterprises, Inc.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.