Click here to Skip to main content
16,023,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want a code to parse a address

if i enter full address i need 2 parse it as
street ,locality,state,country city,postal code
ex :: MS H WILLIAMS
FINANCE AND ACCOUNTING
AUSTRALIA POST
219-241 CLEVELAND ST,STRAWBERRY HILLS NSW 1427

Please tell me the logic

Thanks and regards

Amol
Posted
Comments
OriginalGriff 16-Jun-10 3:34am    
What have you tried?

1 solution

Since you have not mentioned separate inputs for them, assuming you take all of them in a single line, it would be really difficult to parse and get all of them.

Reason being, your input criteria is not putting a constraint on user to enter each of the field. They might jump/eat of some parts!

Still, the way to parse it would be to use enter/comma as delimiter and then try to find what wach of them signify. Since this would be having very bad performance based on number of combinations possible for an address anywhere in the world, I would suggest you to take the inputs as separate fields.

Like:
Street 1 textbox, Locality 1 textbox, State 1 textbox... etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900